Skip to content

Commit b8ac723

Browse files
committed
styles: refactor Buttons
1 parent 6915bbb commit b8ac723

File tree

6 files changed

+60
-15
lines changed

6 files changed

+60
-15
lines changed

app/src/components/common/PageHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Styled = {
2323
`,
2424
BackLink: styled.a`
2525
text-transform: uppercase;
26-
font-size: ${props => props.theme.sizes.s};
26+
font-size: ${props => props.theme.sizes.xs};
2727
cursor: pointer;
2828
color: ${props => props.theme.colors.whitish};
2929

app/src/components/common/base.tsx

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,71 @@ interface ButtonProps {
3636
}
3737

3838
export const Button = styled.button<ButtonProps>`
39+
font-family: ${props => props.theme.fonts.work.medium};
40+
font-size: ${props => props.theme.sizes.s};
3941
min-width: 120px;
4042
height: 44px;
4143
padding-left: 15px;
4244
padding-right: 15px;
4345
margin-left: 10px;
4446
text-align: center;
45-
color: ${props => props.theme.colors.white};
46-
background-color: ${props =>
47-
props.ghost ? 'transparent' : props.theme.colors.tileBack};
48-
border-width: ${props => (props.borderless && !props.primary ? '0' : '1px')};
49-
border-color: ${props =>
50-
props.primary ? props.theme.colors.green : props.theme.colors.white};
51-
border-style: solid;
47+
color: ${props => props.theme.colors.whitish};
48+
background-color: ${props => props.theme.colors.blue};
49+
border: 1px solid ${props => props.theme.colors.whitish};
5250
border-radius: 22px;
53-
opacity: ${props => (props.disabled ? '0.5' : '1')};
5451
5552
&:hover {
56-
opacity: ${props => (props.disabled ? '0.6' : '0.8')};
53+
color: ${props => props.theme.colors.blue};
54+
background-color: ${props => props.theme.colors.white};
55+
cursor: pointer;
5756
}
5857
58+
&:active,
59+
&:focus {
60+
outline: none;
61+
}
62+
63+
${props =>
64+
props.ghost &&
65+
`
66+
background-color: transparent;
67+
&:hover {
68+
color: ${props.theme.colors.whitish};
69+
text-decoration: underline;
70+
background-color: transparent;
71+
}
72+
`}
73+
74+
${props =>
75+
props.disabled &&
76+
`
77+
opacity: 0.5;
78+
&:hover {
79+
cursor: not-allowed;
80+
}
81+
`}
82+
83+
${props =>
84+
props.borderless &&
85+
`
86+
border-width: 0;
87+
`}
88+
89+
${props =>
90+
props.primary &&
91+
`
92+
border: 1px solid ${props.theme.colors.green};
93+
&:hover {
94+
color: ${props.theme.colors.blue};
95+
text-decoration: none;
96+
background-color: ${props.theme.colors.green};
97+
}
98+
`}
99+
59100
svg {
60101
margin-right: 10px;
102+
width: ${props => props.theme.sizes.m};
103+
height: ${props => props.theme.sizes.m};
61104
}
62105
`;
63106

app/src/components/common/text.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const HeaderThree = styled.h3`
2626

2727
export const HeaderFour = styled.h4<HeaderProps>`
2828
font-family: ${props => props.theme.fonts.open.semiBold};
29-
font-size: ${props => props.theme.sizes.s};
29+
font-size: ${props => props.theme.sizes.xs};
3030
line-height: 20px;
3131
text-transform: uppercase;
3232
color: ${props => props.theme.colors.gray};
@@ -39,7 +39,7 @@ export const HeaderFive = styled.h5`
3939
`;
4040

4141
export const Small = styled.p`
42-
font-size: ${props => props.theme.sizes.s};
42+
font-size: ${props => props.theme.sizes.xs};
4343
line-height: 19px;
4444
`;
4545

app/src/components/layout/NavMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Styled = {
1515
list-style: none;
1616
`,
1717
NavItem: styled.li`
18-
font-size: ${props => props.theme.sizes.s};
18+
font-size: ${props => props.theme.sizes.xs};
1919
margin-right: -17px;
2020
2121
span {

app/src/components/loop/swap/StepButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const StepButtons: React.FC<Props> = ({ confirm, onCancel, onNext }) => {
2424
<Button ghost borderless onClick={onCancel}>
2525
{l('cancel')}
2626
</Button>
27-
<Button primary onClick={onNext}>
27+
<Button primary ghost onClick={onNext}>
2828
{confirm ? l('confirm') : l('next')}
2929
</Button>
3030
</Wrapper>

app/src/components/theme.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface Theme {
1818
};
1919
};
2020
sizes: {
21+
xs: string;
2122
s: string;
2223
m: string;
2324
l: string;
@@ -56,7 +57,8 @@ const theme: Theme = {
5657
},
5758
},
5859
sizes: {
59-
s: '14px',
60+
xs: '14px',
61+
s: '16px',
6062
m: '18px',
6163
l: '22px',
6264
xl: '27px',

0 commit comments

Comments
 (0)