mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-20 13:34:30 +01:00
chore: 🔧 remove storybook and update deps
This commit is contained in:
parent
8c287872e0
commit
c838056551
15 changed files with 23860 additions and 17610 deletions
|
@ -8,7 +8,6 @@
|
|||
/docs
|
||||
/.github
|
||||
.vscode
|
||||
.storybook
|
||||
CHANGELOG.md
|
||||
|
||||
# all env files
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
import { configure, addDecorator, addParameters } from '@storybook/react';
|
||||
import themeDecorator from './themeDecorator';
|
||||
import { withKnobs } from '@storybook/addon-knobs';
|
||||
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
|
||||
|
||||
const customViewports = {
|
||||
smallScreen: {
|
||||
name: 'Small Screen',
|
||||
styles: {
|
||||
width: '578px',
|
||||
height: '100%',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
addParameters({
|
||||
viewport: {
|
||||
viewports: { ...INITIAL_VIEWPORTS, ...customViewports },
|
||||
},
|
||||
});
|
||||
addDecorator(themeDecorator);
|
||||
addDecorator(withKnobs);
|
||||
|
||||
configure(require.context('../src/', true, /\.stories\.tsx?$/), module);
|
|
@ -1,7 +0,0 @@
|
|||
module.exports = {
|
||||
addons: [
|
||||
'@storybook/addon-knobs/register',
|
||||
'@storybook/addon-actions',
|
||||
'@storybook/addon-viewport/register',
|
||||
],
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
import { addons } from '@storybook/addons';
|
||||
import { themes } from '@storybook/theming';
|
||||
|
||||
addons.setConfig({
|
||||
theme: themes.dark,
|
||||
panelPosition: 'right',
|
||||
});
|
|
@ -1,35 +0,0 @@
|
|||
import React from 'react';
|
||||
import styled, { ThemeProvider, css } from 'styled-components';
|
||||
import { select, boolean } from '@storybook/addon-knobs';
|
||||
import { backgroundColor, cardColor } from '../src/styles/Themes';
|
||||
|
||||
const StyledBackground = styled.div`
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 100px 0;
|
||||
${({ withBackground, cardBackground }) =>
|
||||
withBackground &&
|
||||
css`
|
||||
background: ${cardBackground ? cardColor : backgroundColor};
|
||||
`}
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
`;
|
||||
|
||||
const ThemeDecorator = storyFn => {
|
||||
const background = boolean('No Background', false);
|
||||
const cardBackground = boolean('Card Background', true);
|
||||
return (
|
||||
<ThemeProvider theme={{ mode: select('Theme', ['dark', 'light'], 'dark') }}>
|
||||
<StyledBackground
|
||||
withBackground={!background}
|
||||
cardBackground={cardBackground}
|
||||
>
|
||||
{storyFn()}
|
||||
</StyledBackground>
|
||||
</ThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default ThemeDecorator;
|
|
@ -1,12 +0,0 @@
|
|||
module.exports = ({ config }) => {
|
||||
config.module.rules.push({
|
||||
test: /\.(ts|tsx)$/,
|
||||
loader: require.resolve('babel-loader'),
|
||||
options: {
|
||||
presets: [require.resolve('babel-preset-react-app')],
|
||||
},
|
||||
});
|
||||
|
||||
config.resolve.extensions.push('.ts', '.tsx');
|
||||
return config;
|
||||
};
|
12
README.md
12
README.md
|
@ -256,18 +256,6 @@ yarn dev
|
|||
npm run dev
|
||||
```
|
||||
|
||||
#### Storybook
|
||||
|
||||
You can also get storybook running for quicker component development.
|
||||
|
||||
```js
|
||||
//Yarn
|
||||
yarn storybook
|
||||
|
||||
//NPM
|
||||
npm run storybook
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
ThunderHub also provides docker images for easier deployment. [Docker Hub](https://hub.docker.com/repository/docker/apotdevin/thunderhub)
|
||||
|
|
23838
package-lock.json
generated
Normal file
23838
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
49
package.json
49
package.json
|
@ -19,7 +19,6 @@
|
|||
"release:test": "standard-version --dry-run",
|
||||
"release:minor": "standard-version --release-as minor && git push --follow-tags origin master",
|
||||
"analyze": "cross-env ANALYZE=true next build",
|
||||
"storybook": "start-storybook -p 6006 -c .storybook",
|
||||
"generate": "graphql-codegen --config codegen.yml",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
|
@ -38,7 +37,6 @@
|
|||
"@apollo/react-common": "^3.1.4",
|
||||
"@apollo/react-hooks": "^3.1.5",
|
||||
"@apollo/react-ssr": "^3.1.5",
|
||||
"@graphql-codegen/near-operation-file-preset": "^1.13.5",
|
||||
"apollo-cache-inmemory": "^1.6.6",
|
||||
"apollo-client": "^2.6.10",
|
||||
"apollo-link-http": "^1.5.17",
|
||||
|
@ -55,13 +53,13 @@
|
|||
"graphql-tag": "^2.10.3",
|
||||
"intersection-observer": "^0.10.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"js-yaml": "^3.14.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"ln-service": "^48.1.0",
|
||||
"ln-service": "^48.2.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.groupby": "^4.6.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"next": "^9.4.1",
|
||||
"next": "^9.4.2",
|
||||
"numeral": "^2.0.6",
|
||||
"qrcode.react": "^1.0.0",
|
||||
"react": "^16.13.1",
|
||||
|
@ -72,14 +70,14 @@
|
|||
"react-qr-reader": "^2.2.1",
|
||||
"react-spinners": "^0.8.3",
|
||||
"react-spring": "^8.0.27",
|
||||
"react-toastify": "^6.0.4",
|
||||
"react-toastify": "^6.0.5",
|
||||
"react-tooltip": "^4.2.6",
|
||||
"styled-components": "^5.1.0",
|
||||
"styled-components": "^5.1.1",
|
||||
"styled-react-modal": "^2.0.1",
|
||||
"styled-theming": "^2.2.0",
|
||||
"underscore": "^1.10.2",
|
||||
"uuid": "^8.0.0",
|
||||
"victory": "^34.3.6",
|
||||
"uuid": "^8.1.0",
|
||||
"victory": "^34.3.7",
|
||||
"winston": "^3.2.1",
|
||||
"zxcvbn": "^4.4.2"
|
||||
},
|
||||
|
@ -87,26 +85,23 @@
|
|||
"@babel/core": "^7.9.6",
|
||||
"@commitlint/cli": "^8.3.5",
|
||||
"@commitlint/config-conventional": "^8.3.4",
|
||||
"@graphql-codegen/cli": "^1.13.5",
|
||||
"@graphql-codegen/introspection": "1.13.5",
|
||||
"@graphql-codegen/typescript": "1.13.5",
|
||||
"@graphql-codegen/typescript-operations": "^1.13.5",
|
||||
"@graphql-codegen/typescript-react-apollo": "1.13.5",
|
||||
"@graphql-codegen/typescript-resolvers": "1.13.5",
|
||||
"@next/bundle-analyzer": "^9.4.1",
|
||||
"@storybook/addon-actions": "^5.3.18",
|
||||
"@storybook/addon-knobs": "^5.3.18",
|
||||
"@storybook/addon-viewport": "^5.3.18",
|
||||
"@storybook/react": "^5.3.18",
|
||||
"@testing-library/jest-dom": "^5.7.0",
|
||||
"@graphql-codegen/cli": "^1.14.0",
|
||||
"@graphql-codegen/introspection": "1.14.0",
|
||||
"@graphql-codegen/typescript": "1.14.0",
|
||||
"@graphql-codegen/near-operation-file-preset": "^1.14.0",
|
||||
"@graphql-codegen/typescript-operations": "^1.14.0",
|
||||
"@graphql-codegen/typescript-react-apollo": "1.14.0",
|
||||
"@graphql-codegen/typescript-resolvers": "1.14.0",
|
||||
"@next/bundle-analyzer": "^9.4.2",
|
||||
"@testing-library/jest-dom": "^5.8.0",
|
||||
"@testing-library/react": "^10.0.4",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"@types/node": "^14.0.5",
|
||||
"@types/react": "^16.9.35",
|
||||
"@types/styled-components": "^5.1.0",
|
||||
"@types/styled-theming": "^2.2.3",
|
||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
||||
"@typescript-eslint/parser": "^2.34.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.0.1",
|
||||
"@typescript-eslint/parser": "^3.0.1",
|
||||
"babel-jest": "^26.0.1",
|
||||
"babel-loader": "^8.1.0",
|
||||
"babel-plugin-inline-react-svg": "^1.1.1",
|
||||
|
@ -114,7 +109,7 @@
|
|||
"babel-preset-react-app": "^9.1.2",
|
||||
"cross-env": "^7.0.2",
|
||||
"devmoji": "^2.1.9",
|
||||
"eslint": "^7.0.0",
|
||||
"eslint": "^7.1.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-jest": "^23.13.1",
|
||||
|
@ -125,10 +120,10 @@
|
|||
"fast-diff": "^1.2.0",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^26.0.1",
|
||||
"lint-staged": "^10.2.4",
|
||||
"lint-staged": "^10.2.6",
|
||||
"prettier": "^2.0.5",
|
||||
"standard-version": "^8.0.0",
|
||||
"typescript": "^3.9.2"
|
||||
"typescript": "^3.9.3"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
import React from 'react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { text, boolean, color } from '@storybook/addon-knobs';
|
||||
import { ColorButton } from './ColorButton';
|
||||
|
||||
export default {
|
||||
title: 'Color Button',
|
||||
};
|
||||
|
||||
export const Default = () => {
|
||||
const withColor = boolean('With Color', false);
|
||||
|
||||
const buttonColor = withColor ? { color: color('Color', 'yellow') } : {};
|
||||
|
||||
return (
|
||||
<ColorButton
|
||||
{...buttonColor}
|
||||
loading={boolean('Loading', false)}
|
||||
disabled={boolean('Disabled', false)}
|
||||
arrow={boolean('With Arrow', false)}
|
||||
selected={boolean('Selected', false)}
|
||||
onClick={action('clicked')}
|
||||
withMargin={text('Margin', '')}
|
||||
withBorder={boolean('With Border', false)}
|
||||
fullWidth={boolean('Full Width', false)}
|
||||
width={text('Width', '')}
|
||||
>
|
||||
{text('Text', 'Button')}
|
||||
</ColorButton>
|
||||
);
|
||||
};
|
|
@ -1,51 +0,0 @@
|
|||
import React, { useState } from 'react';
|
||||
import { boolean, color } from '@storybook/addon-knobs';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { MultiButton, SingleButton } from './MultiButton';
|
||||
|
||||
export default {
|
||||
title: 'Multi Button',
|
||||
};
|
||||
|
||||
export const Default = () => {
|
||||
const withColor = boolean('With Color', false);
|
||||
|
||||
const buttonColor = withColor ? { color: color('Color', 'yellow') } : {};
|
||||
|
||||
const [selected, setSelected] = useState(0);
|
||||
|
||||
return (
|
||||
<MultiButton>
|
||||
<SingleButton
|
||||
{...buttonColor}
|
||||
selected={selected === 0}
|
||||
onClick={() => {
|
||||
action('Button 1 clicked')();
|
||||
setSelected(0);
|
||||
}}
|
||||
>
|
||||
Button 1
|
||||
</SingleButton>
|
||||
<SingleButton
|
||||
{...buttonColor}
|
||||
selected={selected === 1}
|
||||
onClick={() => {
|
||||
action('Button 2 clicked')();
|
||||
setSelected(1);
|
||||
}}
|
||||
>
|
||||
Button 2
|
||||
</SingleButton>
|
||||
<SingleButton
|
||||
{...buttonColor}
|
||||
selected={selected === 2}
|
||||
onClick={() => {
|
||||
action('Button 3 clicked')();
|
||||
setSelected(2);
|
||||
}}
|
||||
>
|
||||
Button 3
|
||||
</SingleButton>
|
||||
</MultiButton>
|
||||
);
|
||||
};
|
|
@ -1,24 +0,0 @@
|
|||
import React from 'react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { select, color, boolean, text } from '@storybook/addon-knobs';
|
||||
import { Input } from './Input';
|
||||
|
||||
export default {
|
||||
title: 'Input',
|
||||
};
|
||||
|
||||
export const Default = () => {
|
||||
const withColor = boolean('With Color', false);
|
||||
|
||||
const buttonColor = withColor ? { color: color('Color', 'yellow') } : {};
|
||||
|
||||
return (
|
||||
<Input
|
||||
{...buttonColor}
|
||||
placeholder={text('Placeholder', 'placeholder')}
|
||||
fullWidth={boolean('Full Width', false)}
|
||||
type={select('Type', ['normal', 'number'], 'normal')}
|
||||
onChange={action('change')}
|
||||
/>
|
||||
);
|
||||
};
|
|
@ -1,18 +0,0 @@
|
|||
import React from 'react';
|
||||
import { text } from '@storybook/addon-knobs';
|
||||
import { Link } from './Link';
|
||||
|
||||
export default {
|
||||
title: 'Link',
|
||||
};
|
||||
|
||||
export const Default = () => {
|
||||
const linkText = text('Link Text', 'This is a link');
|
||||
|
||||
return (
|
||||
<>
|
||||
<Link href={'google.com'}>{linkText}</Link>{' '}
|
||||
<Link to={'/'}>{linkText}</Link>
|
||||
</>
|
||||
);
|
||||
};
|
|
@ -1,20 +0,0 @@
|
|||
import React from 'react';
|
||||
import { number } from '@storybook/addon-knobs';
|
||||
import { Rating } from './Rating';
|
||||
|
||||
export default {
|
||||
title: 'Ratings',
|
||||
};
|
||||
|
||||
export const Default = () => {
|
||||
const options = {
|
||||
range: true,
|
||||
min: 0,
|
||||
max: 10,
|
||||
step: 1,
|
||||
};
|
||||
|
||||
const rating = number('Rating', 5, options);
|
||||
|
||||
return <Rating rating={rating / 10} />;
|
||||
};
|
Loading…
Add table
Reference in a new issue