Skip to content

Commit 8fb2b19

Browse files
committed
🔨 refac: button style
1 parent 7ed1b87 commit 8fb2b19

File tree

8 files changed

+25
-30
lines changed

8 files changed

+25
-30
lines changed

src/pages/battlefield/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React, { FC, useState } from 'react';
22

3+
import Button from '~/components/Button';
34
import SearchRepository from '~/components/SearchRepository';
45
import Layout from '~/Layout';
56

6-
import { Container, ButtonGroup, NextButton } from './styles';
7+
import { Container } from './styles';
8+
import { ButtonGroup } from '~/styles/button';
79

810
const Battlefield: FC = () => {
911
const [disabled, setDisabled] = useState(false);
@@ -14,10 +16,10 @@ const Battlefield: FC = () => {
1416
<h1>Select the battlefield repository</h1>
1517
<SearchRepository setDisabled={setDisabled} />
1618
<ButtonGroup>
17-
<NextButton to="/">Back</NextButton>
18-
<NextButton to="/fighters" disabled={disabled}>
19+
<Button to="/">Back</Button>
20+
<Button to="/fighters" disabled={disabled}>
1921
Next
20-
</NextButton>
22+
</Button>
2123
</ButtonGroup>
2224
</Container>
2325
</Layout>

src/pages/battlefield/styles.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import styled from 'styled-components';
22

3-
import Button from '~/components/Button';
4-
53
export const Container = styled.div`
64
display: flex;
75
flex-direction: column;
@@ -16,17 +14,3 @@ export const Container = styled.div`
1614
text-align: center;
1715
}
1816
`;
19-
20-
export const ButtonGroup = styled.div`
21-
display: flex;
22-
align-items: center;
23-
justify-content: space-between;
24-
25-
margin: 80px 0 40px;
26-
27-
width: 100%;
28-
`;
29-
30-
export const NextButton = styled(Button)`
31-
padding: 0 24px;
32-
`;

src/pages/fighters/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import React, { useContext } from 'react';
33
import { useQuery } from '@apollo/react-hooks';
44
import gql from 'graphql-tag';
55

6+
import Button from '~/components/Button';
67
import Fighter from '~/components/Fighter';
78
import Layout from '~/Layout';
89

910
import RepositoryContext, { PullRequest } from '~/contexts/RepositoryContext';
1011

11-
import { ButtonGroup, NextButton } from '../battlefield/styles';
12-
1312
import { Container } from './styles';
13+
import { ButtonGroup } from '~/styles/button';
1414

1515
interface QueryData {
1616
repository: {
@@ -81,10 +81,10 @@ function Fighters() {
8181
))}
8282
</ul>
8383
<ButtonGroup>
84-
<NextButton to="/battlefield">Back</NextButton>
85-
<NextButton to="/result" disabled={ButtonIsDisabled}>
84+
<Button to="/battlefield">Back</Button>
85+
<Button to="/result" disabled={ButtonIsDisabled}>
8686
Next
87-
</NextButton>
87+
</Button>
8888
</ButtonGroup>
8989
</Container>
9090
</Layout>

src/pages/fighters/styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export const Container = styled.div`
55
flex-direction: column;
66
align-items: center;
77
8-
padding: 24px;
98
max-width: 829px;
109
margin: 0 auto;
1110

src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Home from '~/components/sections/Home';
44
import Layout from '~/Layout';
55

66
const IndexPage: FC = () => (
7-
<Layout>
7+
<Layout title="Home">
88
<Home />
99
</Layout>
1010
);

src/pages/result/styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const Header = styled.header`
88
justify-content: space-between;
99
1010
width: 100%;
11-
max-width: 1170px;
1211
1312
div {
1413
margin: 32px 0;

src/styles/button.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css } from 'styled-components';
1+
import styled, { css } from 'styled-components';
22

33
export interface ButtonProps {
44
secundary?: boolean;
@@ -64,3 +64,13 @@ export default css<ButtonProps>`
6464
box-shadow: none;
6565
`};
6666
`;
67+
68+
export const ButtonGroup = styled.div`
69+
display: flex;
70+
align-items: center;
71+
justify-content: space-between;
72+
73+
margin: 80px 0 40px;
74+
75+
width: 100%;
76+
`;

src/styles/global.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ export default createGlobalStyle`
5757
position: relative;
5858
5959
margin: 0 auto;
60+
padding: 0 32px;
6061
61-
max-width: 1440;
62+
max-width: 1234px;
6263
min-height: 100%;
6364
}
6465

0 commit comments

Comments
 (0)