-
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
b142745
commit 7b00893
Showing
7 changed files
with
423 additions
and
1 deletion.
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) | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.