Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(component): add Quote component #82

Merged
merged 2 commits into from
Aug 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';