Skip to content

Commit 9a03091

Browse files
add distinct styles for UrlButton
1 parent 76eea63 commit 9a03091

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/components/UrlButton.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import Button from './Button';
3+
import styled from 'styled-components';
4+
5+
const UrlButtonContainer = styled.a(props => props.theme.urlButton);
46

57
export default function UrlButton({ href, target, children }) {
68
const extraProps = {};
@@ -9,9 +11,9 @@ export default function UrlButton({ href, target, children }) {
911
}
1012

1113
return (
12-
<Button as="a" href={href} className="url-button" {...extraProps}>
14+
<UrlButtonContainer href={href} className="url-button" {...extraProps}>
1315
{children}
14-
</Button>
16+
</UrlButtonContainer>
1517
);
1618
}
1719

src/themes/default.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ const defaultTheme = {
33
fontSize: '1rem',
44
fontFamily: `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
55
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
6-
a: {
7-
color: '#EC24B5',
8-
'&.url-button': {
9-
color: '#fff',
10-
},
11-
},
126
},
137
timelineTrack: {
148
position: 'absolute',
@@ -36,7 +30,6 @@ const defaultTheme = {
3630
maxWidth: '560px',
3731
},
3832
button: {
39-
display: 'inline-block',
4033
fontSize: '14px',
4134
backgroundColor: 'rebeccapurple',
4235
borderRadius: '4px',
@@ -47,6 +40,17 @@ const defaultTheme = {
4740
textDecoration: 'none',
4841
cursor: 'pointer',
4942
},
43+
urlButton: {
44+
display: 'inline-block',
45+
fontSize: '14px',
46+
backgroundColor: 'rebeccapurple',
47+
borderRadius: '4px',
48+
padding: '6px',
49+
margin: '10px 5px 5px 0',
50+
border: 'none',
51+
textDecoration: 'none',
52+
color: '#fff',
53+
},
5054
date: {
5155
backgroundColor: '#ec24b5',
5256
padding: '4px',

0 commit comments

Comments
 (0)