-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(component): add Quote component (#82)
* feat(component): add Quote Add new component Quote Resolves #76 Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com> * feat(stories): add stories for Quote Add new stories for Quote component Resolves #76 Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
- Loading branch information
1 parent
f2cbf8d
commit 5a1a269
Showing
4 changed files
with
42 additions
and
0 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,17 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
|
||
import { Quote } from './Quote'; | ||
|
||
export default { | ||
component: Quote, | ||
} as ComponentMeta<typeof Quote>; | ||
|
||
//“template” of how args map to rendering | ||
const Template: ComponentStory<typeof Quote> = (args) => <Quote {...args} />; | ||
|
||
export const Default = Template.bind({}); | ||
|
||
Default.args = { | ||
children: 'This is a Text Quote', | ||
}; |
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,23 @@ | ||
import { ReactNode } from 'react'; | ||
import { makeStyles } from '../../utils/makeStyles'; | ||
import { BaseStyleProp } from '../types'; | ||
|
||
type QuoteStyles = 'root'; | ||
|
||
export interface QuoteProps extends BaseStyleProp<QuoteStyles> { | ||
children?: ReactNode; | ||
} | ||
|
||
const useStyles = makeStyles({ | ||
root: { margin: 0, padding: 0 }, | ||
}); | ||
|
||
export const Quote = ({ children, classes, className }: QuoteProps) => { | ||
const styles = useStyles({ classes }); | ||
|
||
return ( | ||
<div style={styles.root} className={className}> | ||
{children} | ||
</div> | ||
); | ||
}; |
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 @@ | ||
export { Quote, QuoteProps } from './Quote'; |
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