-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
98f8d48
commit f5dbd50
Showing
5 changed files
with
170 additions
and
83 deletions.
There are no files selected for viewing
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
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 |
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
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) | ||
}) | ||
}) |
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
Oops, something went wrong.