Skip to content

Commit 5de606c

Browse files
author
Turbo
committed
Refactor page
1 parent 91b85d9 commit 5de606c

File tree

36 files changed

+136
-181
lines changed

36 files changed

+136
-181
lines changed

src/App/RouteComponents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Route, Switch } from 'react-router';
44
import Header from 'src/Components/Header';
55
import Footer from 'src/Components/Footer';
66
import Loading from 'src/Components/Loading';
7-
import { RedirectWithStatus } from 'src/Components/SSR';
7+
import { RedirectWithStatus } from 'src/Components/Route';
88

99
/*
1010
* Create a Universal Component template, allowing SSR a component + Code Splitting

src/Components/Footer/index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import { Image, Box } from 'rebass';
4-
import FlexBox from 'src/Components/FlexBox';
5-
import { TextBlock } from 'src/Components/Typo';
4+
import { FlexBox } from 'src/Components/Layout';
5+
import { Text } from 'src/Components/Typo';
66

77
const imagePath = require('src/static/images/full-logo.svg');
88

9-
const BoxWithFooter = Box.withComponent('footer');
10-
11-
const StyledFooter = styled(BoxWithFooter)`
9+
const StyledFooter = styled(Box)`
1210
width: 100%;
1311
min-height: max-content;
1412
position: absolute;
@@ -19,13 +17,13 @@ const StyledFooter = styled(BoxWithFooter)`
1917
`;
2018

2119
const Footer = () => (
22-
<StyledFooter py={[2, 3, 4]} px={[3, 4, 5]}>
20+
<StyledFooter as="footer" py={[2, 3, 4]} px={[3, 4, 5]}>
2321
<FlexBox>
2422
<Image src={imagePath} alt="Brightizen" width="100px" />
2523

26-
<TextBlock color="black">
24+
<Text color="black">
2725
Copyright © 2018 Brightizen
28-
</TextBlock>
26+
</Text>
2927
</FlexBox>
3028
</StyledFooter>
3129
);

src/Components/FormElements/Form/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import PropTypes from 'prop-types';
4-
import FlexBox from 'src/Components/FlexBox';
4+
import { FlexBox } from 'src/Components/Layout';
55

66
const Form = ({ children, submit, ...rest }) => (
77
<FlexBox {...rest}>

src/Components/FormElements/Input/InputField/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import PropTypes from 'prop-types';
4-
// import Container from 'src/Components/Container';
4+
// import { Container } from 'src/Components/Layout';
55

66
const arrowDown = 'static/icons/arrow_solid_black.svg';
77

@@ -52,8 +52,6 @@ const StyledInputField = styled.input`
5252
}
5353
`;
5454

55-
// const StyledContainerInput = StyledInputField.withComponent('input');
56-
5755
const InputField = ({
5856
id, placeholder, type, ...rest
5957
}) => (

src/Components/FormElements/Input/Label/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import { Text } from 'rebass';
66
const Label = ({
77
id, label, children, ...rest
88
}) => (
9-
<StyledLabel htmlFor={id} {...rest}>
9+
<StyledLabel as="label" htmlFor={id} {...rest}>
1010
{label}
1111
{children}
1212
</StyledLabel>
1313
);
1414

15-
const TextWithLabel = Text.withComponent('label');
16-
17-
const StyledLabel = styled(TextWithLabel)`
15+
const StyledLabel = styled(Text)`
1816
font-family: ${props => props.theme.fonts.body};
1917
display: flex;
2018
flex-direction: column;

src/Components/FormElements/Input/Validation/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import PropTypes from 'prop-types';
4-
import { Span } from 'src/Components/Typo';
4+
import { Text } from 'src/Components/Typo';
55

66
const FormValidation = ({
77
isShow, messageType, message, ...rest
88
}) => (
9-
<StyledFormValidation isShow={isShow} messageType={messageType} {...rest}>
9+
<StyledFormValidation as="span" isShow={isShow} messageType={messageType} {...rest}>
1010
{message}
1111
</StyledFormValidation>
1212
);
1313

14-
const StyledFormValidation = styled(Span)`
14+
const StyledFormValidation = styled(Text)`
1515
width: 100%;
1616
display: ${props => (props.isShow ? 'block' : 'none')};
1717
color: ${props => (props.messageType ? props.theme.colors[props.messageType] : props.theme.colors.black)};

src/Components/FormElements/Input/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33

4-
import FlexBox from 'src/Components/FlexBox';
4+
import { FlexBox } from 'src/Components/Layout';
55
import Label from './Label';
66
import Validation from './Validation';
77
import InputField from './InputField';

src/Components/HTML/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ const Markup = ({
66
<head>
77
<title>Brightizen</title>
88
<meta charSet="utf-8" />
9-
<meta name="theme-color" content="#1890ff">
10-
9+
<meta name="theme-color" content="#FF6D00">
1110
${styles}
1211
${pageTitle}
1312
${pageMeta}
1413
${pageLink}
15-
1614
<meta name="description" content="This is the description of the website." />
1715
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
1816
${styles}

src/Components/Header/Brand.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const Brand = ({
1414

1515
const StyledBrand = styled(Image)`
1616
max-width: ${props => (props.width ? 'auto' : '100%')};
17+
display: flex;
1718
`;
1819

1920
Brand.defaultProps = {

src/Components/Header/MainNav.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import React from 'react';
12
import styled from 'styled-components';
2-
import Container from 'src/Components/Container';
3+
import { Container } from 'src/Components/Layout';
34

4-
const MainNav = styled(Container)`
5+
const MainNav = ({ ...rest }) => (
6+
<StyledMainNav as="header" {...rest} />
7+
);
8+
9+
const StyledMainNav = styled(Container)`
510
width: 100%;
611
box-shadow: ${props => props.theme.boxShadows[0]};
712
font-weight: ${props => props.theme.fontWeights[7]};

0 commit comments

Comments
 (0)