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(link): default styles for link #105

Merged
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
2 changes: 1 addition & 1 deletion src/components/DefaultTheme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const defaultTheme: ThemeOptions = {
primary: {},
secondary: {},
},
link: { root: {} },
link: { root: { color: '#0000EE', textDecoration: 'none' } },
divider: { root: {} },
typography: { root: {} },
image: {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Link/Link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ export const Default = Template.bind({});
Default.args = {
children: 'Click here',
href: 'https://github.com/leopardslab/react-email',
};

export const CustomStyles = Template.bind({});
CustomStyles.args = {
children: 'Click here',
href: 'https://github.com/leopardslab/react-email',
classes: {
root: {
color: 'red',
textDecoration: 'underline',
},
},
};
31 changes: 30 additions & 1 deletion src/components/Link/__snapshots__/Link.stories.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components/Link CustomStyles smoke-test 1`] = `
<div style="margin: 0px auto; max-width: 600px;">
<table cellpadding="0"
cellspacing="0"
role="presentation"
style="border: 0px; vertical-align: top; width: 100%;"
>
<tbody>
<tr>
<td align="center"
style="vertical-align: top;"
>
<h2>
Please
<a href="https://github.com/leopardslab/react-email"
target="_blank"
style="color: red; text-decoration: underline;"
>
Click here
</a>
to access
</h2>
</td>
</tr>
</tbody>
</table>
</div>
`;

exports[`components/Link Default smoke-test 1`] = `
<div style="margin: 0px auto; max-width: 600px;">
<table cellpadding="0"
Expand All @@ -16,7 +45,7 @@ exports[`components/Link Default smoke-test 1`] = `
Please
<a href="https://github.com/leopardslab/react-email"
target="_blank"
style="color: red;"
style="color: rgb(0, 0, 238); text-decoration: none;"
>
Click here
</a>
Expand Down