-
Notifications
You must be signed in to change notification settings - Fork 2
Display temp & RH in graph for each station #127
Changes from 11 commits
637929d
ccffb02
44ba715
7b36aa7
6043b4e
abeb01a
3cef349
082126b
c8547fd
59cd93b
46cd625
cfc6939
ed0c75b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import '@storybook/addon-actions/register' | ||
import '@storybook/addon-knobs/register' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { configure, addDecorator } from '@storybook/react' | ||
import { ThemeDecorator } from './decorators/ThemeDecorator' | ||
|
||
const req = require.context('../src', true, /\.stories\.tsx$/) | ||
|
||
function loadStories() { | ||
req.keys().forEach(req) | ||
} | ||
|
||
addDecorator(ThemeDecorator) | ||
|
||
configure(loadStories, module) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { ThemeProvider } from '@material-ui/core/styles' | ||
|
||
import { theme } from '../../src/app/theme' | ||
|
||
export const ThemeDecorator = storyFn => ( | ||
<ThemeProvider theme={theme}>{storyFn()}</ThemeProvider> | ||
) |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,25 +26,29 @@ | |
"@types/react-redux": "^7.1.7", | ||
"@types/react-router-dom": "^5.1.3", | ||
"@types/webpack-env": "^1.15.1", | ||
"@types/recharts": "^1.8.10", | ||
"axios": "^0.19.2", | ||
"clsx": "^1.1.0", | ||
"moment": "^2.26.0", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-redux": "^7.2.0", | ||
"react-router-dom": "^5.1.2", | ||
"react-scripts": "3.4.0", | ||
"react-scripts": "3.4.1", | ||
"recharts": "^1.8.5", | ||
"typescript": "^3.7.5" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"start": "CI=true react-scripts start", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not exactly sure what it does but it fixes the issue where it fails to start in the docker container. |
||
"build": "react-scripts build", | ||
"test": "DEBUG_PRINT_LIMIT=5000 react-scripts test", | ||
"test:ci": "CI=true npm test", | ||
"eject": "react-scripts eject", | ||
"lint": "eslint './src/**/*.{ts,tsx}'", | ||
"lint:fix": "eslint --fix './src/**/*.{ts,tsx}'", | ||
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|md)\"" | ||
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|md)\"", | ||
"storybook": "start-storybook -p 9009 -s public", | ||
"build-storybook": "build-storybook -s public" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
|
@@ -59,6 +63,9 @@ | |
] | ||
}, | ||
"devDependencies": { | ||
"@storybook/addon-actions": "^5.3.19", | ||
"@storybook/addon-knobs": "^5.3.19", | ||
"@storybook/react": "^5.3.19", | ||
"@types/jest": "^24.9.1", | ||
"@typescript-eslint/eslint-plugin": "^2.19.0", | ||
"@typescript-eslint/parser": "^2.19.0", | ||
|
@@ -74,4 +81,4 @@ | |
"pre-push": ".githooks/pre-push & npm run lint & npm run test:ci" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { createMuiTheme } from '@material-ui/core/styles' | ||
|
||
// Theme documentation: https://material-ui.com/customization/palette/ | ||
// Theme demo: https://material.io/resources/color/#!/?view.left=1&view.right=1&primary.color=003365&secondary.color=FBC02D | ||
// Do not export this directly! theme should be accessed within makeStyles & withStyles. Use ErrorMessage.tsx as a reference | ||
export const theme = createMuiTheme({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment says not to export? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I had to make it exportable so that I can use the same theme in Storybook |
||
palette: { | ||
primary: { | ||
light: '#3E5C93', | ||
main: '#003365', | ||
dark: '#000C3A' | ||
}, | ||
secondary: { | ||
light: '#FFF263', | ||
main: '#FBC02D', | ||
dark: '#C49000' | ||
}, | ||
success: { main: '#44D77A' }, | ||
error: { main: '#FF3E34' }, | ||
warning: { main: '#FE7921' }, | ||
contrastThreshold: 3, | ||
tonalOffset: 0.1 | ||
}, | ||
typography: { | ||
button: { | ||
textTransform: 'none' | ||
} | ||
}, | ||
breakpoints: { | ||
values: { | ||
xs: 0, | ||
sm: 600, | ||
md: 1080, // Default: 960 | ||
lg: 1280, | ||
xl: 1920 | ||
} | ||
} | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { action } from '@storybook/addon-actions' | ||
import { withKnobs, select } from '@storybook/addon-knobs' | ||
|
||
import { Button } from 'components' | ||
|
||
storiesOf('Button', module) | ||
.addDecorator(withKnobs) | ||
.add('collections', () => { | ||
const style = { margin: 10 } | ||
const color = select( | ||
'color', | ||
{ Primary: 'primary', Secondary: 'secondary', Default: 'default' }, | ||
'primary' | ||
) | ||
|
||
return ( | ||
<> | ||
<Button | ||
color={color} | ||
variant="contained" | ||
style={style} | ||
onClick={action('clicked')} | ||
> | ||
Button | ||
</Button> | ||
<Button color={color} variant="contained" style={style} loading> | ||
Button | ||
</Button> | ||
<Button color={color} variant="contained" style={style} disabled> | ||
Button | ||
</Button> | ||
</> | ||
) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we rather want?