Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/blank.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

16 changes: 8 additions & 8 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";
import React from 'react';
import { configure, addDecorator } from '@storybook/react';
import { ThemeProvider } from "styled-components";
import Theme from "../src/theme/index";
import {ThemeProvider} from 'styled-components';
import theme from '../src/theme/index';

// automatically import all files ending in *.stories.js
const req = require.context("../src", true, /\.stories\.tsx$/);
const req = require.context('../src', true, /\.stories\.tsx$/);

function loadStories() {
req.keys().forEach(filename => req(filename));
function loadStories(){
req.keys().forEach(filename=>req(filename));
}

addDecorator(story => <ThemeProvider theme={Theme}>{story()}</ThemeProvider>);
addDecorator(story => <ThemeProvider theme={theme}>{story()}</ThemeProvider>);

configure(loadStories, module);
configure(loadStories,module);
13 changes: 0 additions & 13 deletions .storybook/preview-head.html

This file was deleted.

16 changes: 0 additions & 16 deletions .storybook/webpack.config.js

This file was deleted.

40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn storybook`
### `yarn start`

Runs the storybook app in the development mode.<br>
Open [http://localhost:6006](http://localhost:6006) to view it in the browser.
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test:watch`
### `yarn test`

Launches the test runner in the interactive watch mode.<br>
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build-storybook`
### `yarn build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

Builds the storybook for production to the `.out` folder.<br>
To learn React, check out the [React documentation](https://reactjs.org/).
5 changes: 3 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-typescript"]
};
presets: ["@babel/preset-env", "@babel/preset-typescript"]
};

10 changes: 4 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ module.exports = {
transform: {
"\\.(ts|tsx)$": "ts-jest"
},
// globals: {
// "ts-jest": {
// babelConfig: true
// }
// },
testPathIgnorePatterns: ["/node_modules/"],
moduleFileExtensions: ["ts", "tsx", "js", "json"],
setupFilesAfterEnv: ["<rootDir>/setup/setupTest.ts"]
setupFilesAfterEnv: ["<rootDir>/setup/setupTests.ts"],
moduleNameMapper: {
".+\\.(svg|png|jpg)$": "identity-obj-proxy"
}
};
72 changes: 28 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
{
"name": "components",
"name": "userinfo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@types/jest": "^24.0.18",
"@types/node": "12.7.5",
"@types/react": "16.9.2",
"@types/react-dom": "16.9.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1",
"styled-components": "^4.3.2",
"typescript": "3.6.3"
"@types/jest": "24.0.22",
"@types/node": "12.12.7",
"@types/react": "16.9.11",
"@types/react-dom": "16.9.4",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-scripts": "3.2.0",
"styled-components": "^4.4.1",
"typescript": "3.7.2"
},
"scripts": {
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook -c .storybook -o .out",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest -c jest.config.js",
"test:watch": "jest -c jest.config.js --watch",
"prettier": "prettier --write \"packages/**/*{js,json,ts,tsx}\""
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"eslintConfig": {
"extends": "react-app"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,js,tsx}": [
"yarn prettier",
"git add"
]
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -47,27 +36,22 @@
]
},
"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/preset-env": "^7.6.3",
"@babel/preset-react": "^7.6.3",
"@babel/preset-typescript": "^7.6.0",
"@storybook/addon-actions": "^5.2.1",
"@storybook/addon-info": "^5.2.1",
"@storybook/addon-links": "^5.2.1",
"@storybook/addons": "^5.2.1",
"@storybook/react": "^5.2.1",
"@testing-library/jest-dom": "^4.1.2",
"@testing-library/react": "^9.3.0",
"@types/storybook__react": "^4.0.2",
"@types/styled-components": "^4.1.19",
"awesome-typescript-loader": "^5.2.1",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-typescript": "^7.7.2",
"@storybook/addon-actions": "^5.2.6",
"@storybook/addon-links": "^5.2.6",
"@storybook/addons": "^5.2.6",
"@storybook/react": "^5.2.6",
"@testing-library/jest-dom": "^4.2.3",
"@testing-library/react": "^9.3.2",
"@types/styled-components": "^4.4.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"husky": "3.0.8",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.9.0",
"prettier": "1.18.2",
"react-docgen-typescript-loader": "^3.2.1",
"react-test-renderer": "^16.10.2",
"jest-dom": "^4.0.0",
"react-test-renderer": "^16.11.0",
"ts-jest": "^24.1.0"
}
}
}
Binary file modified public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
}
],
"start_url": ".",
"display": "standalone",
Expand Down
1 change: 0 additions & 1 deletion setup/setupTest.ts

This file was deleted.

1 change: 1 addition & 0 deletions setup/setupTests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom/extend-expect';
9 changes: 9 additions & 0 deletions src/asset/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const detail = {
name:'Sameer Khanal',
role:'Developer'
}

export const skills = ['Nodejs','Reactjs','Graphql'];
export const Companies = ['Ex-MicroSoft','Ex-Facebook','Ex-Google'];
export const rate = {total:10,rating:4}
export const number = [1,2,3,4,5,6,7]
1 change: 1 addition & 0 deletions src/asset/star-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/asset/star-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/asset/user-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/component/bullet/bullet.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import {render} from '@testing-library/react';
import TestThemeProvider from '../../utils/TestThemeProvider';
import Component from './';
import {DataProps} from './types';
import {number} from '../../asset'

const Bullet: React.FC<DataProps> =(props)=>(
<TestThemeProvider>
<Component {...props}/>
</TestThemeProvider>
);

describe("Bullet Props",()=>{
it("should render round Bullets", ()=>{
const {container} = render(<Bullet data={number} round/>);
const cont = container.children.item;
expect(cont).toContainElement
})
})
10 changes: 10 additions & 0 deletions src/component/bullet/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import {storiesOf} from '@storybook/react';
import Component from './';
import {number,skills} from '../../asset'

storiesOf("Bullet",module)
.add("Default Bullet with String data",()=>
(<Component data={skills}/>))
.add("Rounded bullet with number",()=>
(<Component data={number} round/>))
Loading