Skip to content

Commit

Permalink
v0.4.0 -> v0.5.0 (#105)
Browse files Browse the repository at this point in the history
* feat #99 - Avatar component (#103)
* feat #100 - Notification component should take in configuration options (#103)
* feat #101 - Icon component should render svgs (#103)
* feat #92 - Theming (#97)
* fix #104 - Fix exported types for table and form (#97)
  • Loading branch information
nancy-dassana authored and sam-dassana committed Oct 19, 2020
1 parent b142745 commit 7b00893
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .storybook/Decorator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { FC, ReactNode } from 'react'
import { createUseStyles } from 'react-jss'
import { ThemeType, themes } from '../src/components/assets/styles/themes'
import cn from 'classnames'
const { dark } = ThemeType

const useStyles = createUseStyles({
'@global': {
[`.${dark} .decorator`]: {
backgroundColor: themes[dark].background.secondary
}
},
decorator: {
padding: '1rem'
}
})

export interface DecoratorProps {
children: ReactNode
classes?: string[]
}

const Decorator: FC<DecoratorProps> = ({
children,
classes = []
}: DecoratorProps) => {
const decoratorClasses = useStyles()

return (
<div
className={cn(decoratorClasses.decorator, 'decorator', ...classes)}
>
{children}
</div>
)
}

export default Decorator
13 changes: 13 additions & 0 deletions .storybook/__tests__/Decorator.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import Decorator, { DecoratorProps } from '../Decorator'
import { shallow, ShallowWrapper } from 'enzyme'

let wrapper: ShallowWrapper<DecoratorProps>

describe('Decorator', () => {
it('renders', () => {
wrapper = shallow(<Decorator>Decorator</Decorator>)

expect(wrapper).toHaveLength(1)
})
})
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7b00893

Please sign in to comment.