Skip to content

Commit

Permalink
feat(quote): default styles for quote (#107)
Browse files Browse the repository at this point in the history
Add default styles inside defaultTheme config object and update stories and snapshots of Quote
component

Resolves #101

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Sep 9, 2022
1 parent d4aea35 commit a35fdbb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
11 changes: 10 additions & 1 deletion src/components/DefaultTheme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,14 @@ export const defaultTheme: ThemeOptions = {
imageColumn: {},
},
preheader: { root: {} },
quote: { root: {} },
quote: {
root: {
borderLeft: '4px solid #d0d7de',
padding: '6px',
paddingLeft: '10px',
color: '#7e8698',
fontStyle: 'italic',
fontSize: '1.1em',
},
},
};
9 changes: 7 additions & 2 deletions src/components/Quote/Quote.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { Email } from '../Email/Email';

import { Quote } from './Quote';

Expand All @@ -7,10 +8,14 @@ export default {
} as ComponentMeta<typeof Quote>;

//“template” of how args map to rendering
const Template: ComponentStory<typeof Quote> = (args) => <Quote {...args} />;
const Template: ComponentStory<typeof Quote> = (args) => (
<Email>
<Quote {...args} />
</Email>
);

export const Default = Template.bind({});

Default.args = {
children: 'This is a Text Quote',
children: 'This is a Text Quote Component written in TypeScript',
};
10 changes: 6 additions & 4 deletions src/components/Quote/__snapshots__/Quote.stories.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components/Quote Default smoke-test 1`] = `
<div id="quote"
style="margin: 0px; padding: 0px;"
>
This is a Text Quote
<div style="margin: 0px auto; max-width: 600px;">
<div id="quote"
style="margin: 0px; padding: 6px 6px 6px 10px; border-left: 4px solid rgb(208, 215, 222); color: rgb(126, 134, 152); font-style: italic; font-size: 1.1em;"
>
This is a Text Quote Component written in TypeScript
</div>
</div>
`;

0 comments on commit a35fdbb

Please sign in to comment.