Skip to content

Commit

Permalink
feat(component): add Quote component (#82)
Browse files Browse the repository at this point in the history
* 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
niloysikdar committed Aug 7, 2022
1 parent f2cbf8d commit 5a1a269
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/Quote/Quote.stories.tsx
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',
};
23 changes: 23 additions & 0 deletions src/components/Quote/Quote.tsx
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>
);
};
1 change: 1 addition & 0 deletions src/components/Quote/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Quote, QuoteProps } from './Quote';
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './Divider';
export * from './Typography';
export * from './Image';
export * from './Preheader';
export * from './Quote';

0 comments on commit 5a1a269

Please sign in to comment.