This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "airbnb", | |
"rules": { | |
"func-names": ["error", "never"], | |
"no-return-assign": 0, | |
"react/forbid-prop-types": 0, | |
"react/no-array-index-key": 0, | |
"import/prefer-default-export": 0, | |
"import/no-extraneous-dependencies": [ | |
"error", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"stylist":"Daniela", | |
"date":{"date":"2018-08-16"}, | |
"slot":{"slot":"08:00"}, | |
"orderConfirmationComment":{"orderConfirmationComment":"Thank you for your help!"}, | |
"phone":{"phone":"+4914128872"} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* src/components/Counter/index.js */ | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import classNames from 'classnames/bind'; | |
import './index.css'; | |
const Counter = (props) => { | |
const { | |
amount, | |
...other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* src/components/Counter/test/Counter.test.js */ | |
import React from 'react' | |
import Counter from '../'; | |
describe('Counter', () => { | |
it('increases the amount on plus interaction', () => { | |
// tbd | |
}); | |
it('decreases the amount on minus interaction', () => { | |
// tbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* stories/Counter.stories.js */ | |
import React from 'react'; | |
import { storiesOf } from '@storybook/react'; | |
import Counter from './../src/components/Counter'; | |
storiesOf('Components', module) | |
.addParameters({ | |
info: { | |
inline: true, | |
header: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* .storybook/addons.js */ | |
import '@storybook/addon-actions/register'; | |
import '@storybook/addon-links/register'; | |
import '@storybook/addon-a11y/register'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* .storybook/config.js */ | |
import { configure, addDecorator } from '@storybook/react'; | |
import { withA11y } from '@storybook/addon-a11y'; | |
addDecorator(withA11y); | |
// automatically import all files ending in *.stories.js | |
configure(require.context('../stories', true, /\.stories\.js$/), module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* src/components/Counter/index.js */ | |
... | |
return ( | |
<div class={counterClasses} {...other}> | |
<button> | |
- | |
</button> | |
<input type='text' readonly value={amount} aria-label="current amount"/> | |
<button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* src/components/Calendar/index.js */ | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
const Calendar = (props) => { | |
const { | |
data, | |
...other | |
} = props; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calcAverage(data){ | |
const sum = data.reduce((a, b) => a + b, 0); | |
return sum / data.length; | |
} |
OlderNewer