Skip to content

Commit

Permalink
Fixes #10: Split style file into proper files
Browse files Browse the repository at this point in the history
  • Loading branch information
Nargonath committed Jul 18, 2017
1 parent 93a5e53 commit 7eda13e
Show file tree
Hide file tree
Showing 21 changed files with 204 additions and 168 deletions.
16 changes: 16 additions & 0 deletions src/components/Footer/A.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from 'styled-components';

export default styled.a`
color: white;
text-decoration: none;
position: relative;
&:before {
content: '';
position: absolute;
border-bottom: 1px solid white;
left: 0;
right: 0;
bottom: -2px;
}
`;
7 changes: 7 additions & 0 deletions src/components/Footer/Br.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import styled from 'styled-components';

import { media } from 'styles';

export default styled.br`
${media.laptop`display: none`};
`;
21 changes: 21 additions & 0 deletions src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from 'styled-components';

import { primaryColor, media } from 'styles';

export default styled.footer`
height: 50px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
color: white;
text-align: center;
background-color: ${primaryColor};
padding: 10px;
display: flex;
font-weight: 100;
${media.tablet`
height: 30px;
`};
`;
49 changes: 0 additions & 49 deletions src/components/Footer/Footer.style.js

This file was deleted.

7 changes: 7 additions & 0 deletions src/components/Footer/GithubLink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import styled from 'styled-components';

export default styled.a`
width: 30px;
height: auto;
margin: auto 0;
`;
6 changes: 6 additions & 0 deletions src/components/Footer/P.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import styled from 'styled-components';

export default styled.p`
display: inline-block;
margin: auto;
`;
6 changes: 5 additions & 1 deletion src/components/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';

import githubLogo from './github.svg';
import { StyledFooter, P, A, Br, GithubLink } from './Footer.style';
import StyledFooter from './Footer';
import P from './P';
import A from './A';
import Br from './Br';
import GithubLink from './GithubLink';

function Footer() {
return (
Expand Down
21 changes: 21 additions & 0 deletions src/components/Timer/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from 'styled-components';

import { primaryColor, media } from 'styles';

export default styled.button`
background-color: ${primaryColor};
color: white;
border: 0;
font-weight: 700;
padding: .8em;
display: block;
margin: 0 auto 10px auto;
width: 80%;
font-size: 1.5em;
cursor: pointer;
${media.tablet`
width: 300px;
margin: 0 auto 10px auto;
`};
`;
15 changes: 15 additions & 0 deletions src/components/Timer/Counter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styled from 'styled-components';

import { secondaryColor, media } from 'styles';

export default styled.div`
color: ${secondaryColor};
font-weight: 700;
text-align: center;
font-size: 5em;
margin-bottom: 5%;
${media.tablet`
margin-bottom: 20px;
`};
`;
11 changes: 11 additions & 0 deletions src/components/Timer/TaskName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from 'styled-components';

import { primaryColor } from 'styles';

export default styled.p`
color: ${primaryColor};
font-weight: 400;
text-align: center;
font-size: 3em;
margin: 0;
`;
41 changes: 0 additions & 41 deletions src/components/Timer/Timer.style.js

This file was deleted.

4 changes: 3 additions & 1 deletion src/components/Timer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React, { Component } from 'react';
import { func, shape, string } from 'prop-types';

import { zeroPad } from 'services/string';
import { Button, Counter, TaskName } from './Timer.style';
import Button from './Button';
import Counter from './Counter';
import TaskName from './TaskName';

class Timer extends Component {
constructor(props) {
Expand Down
23 changes: 23 additions & 0 deletions src/components/TimerForm/Input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styled from 'styled-components';

import { primaryColor, secondaryColor, media } from 'styles';

export default styled.input`
display: block;
border: 0;
border-bottom: 1px solid ${primaryColor};
margin: 10% auto;
width: 80%;
font-size: 1.5em;
background-color: transparent;
&::placeholder {
color: ${secondaryColor};
opacity: 0.6;
}
${media.tablet`
width: 300px;
margin: 40px auto;
`};
`;
21 changes: 21 additions & 0 deletions src/components/TimerForm/Submit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from 'styled-components';

import { primaryColor, media } from 'styles';

export default styled.input`
background-color: ${primaryColor};
color: white;
border: 0;
font-weight: 700;
padding: .8em;
display: block;
margin: auto;
width: 80%;
font-size: 1.5em;
cursor: pointer;
${media.tablet`
margin: 40px auto;
width: 300px;
`};
`;
41 changes: 0 additions & 41 deletions src/components/TimerForm/TimerForm.style.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/TimerForm/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { Component } from 'react';
import { func } from 'prop-types';

import { Input, Submit } from './TimerForm.style';
import Input from './Input';
import Submit from './Submit';

class TimerForm extends Component {
constructor(props) {
Expand Down
11 changes: 11 additions & 0 deletions src/scenes/Home/Logo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from 'styled-components';

import { media } from 'styles';

export default styled.img`
display: block;
${media.tablet`
display: inline-block;
`};
`;
16 changes: 16 additions & 0 deletions src/scenes/Home/LogoCtn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from 'styled-components';

import { media } from 'styles';

export default styled.div`
margin: 10% auto 5% auto;
width: 7.143em;
${media.tablet`
margin: 30px 50px 5vh 50px;
`} ${media.desktop`
margin-bottom: 7vh;
`} ${media.big`
margin-bottom: 18vh;
`};
`;
33 changes: 2 additions & 31 deletions src/scenes/Home/Home.style.js → src/scenes/Home/Root.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import styled from 'styled-components';

import { media, secondaryColor } from 'styles';
import { media } from 'styles';

export const Root = styled.div`
export default styled.div`
@font-face {
font-family: 'Open Sans', sans-serif;
font-weight: 300;
Expand Down Expand Up @@ -35,32 +35,3 @@ export const Root = styled.div`
font-size: 18px;
`};
`;

export const LogoCtn = styled.div`
margin: 10% auto 5% auto;
width: 7.143em;
${media.tablet`
margin: 30px 50px 5vh 50px;
`} ${media.desktop`
margin-bottom: 7vh;
`} ${media.big`
margin-bottom: 18vh;
`};
`;

export const Title = styled.h1`
margin: 0;
font-family: 'Roboto';
font-weight: 400;
color: ${secondaryColor};
font-size: 1.2em;
`;

export const Logo = styled.img`
display: block;
${media.tablet`
display: inline-block;
`};
`;
Loading

0 comments on commit 7eda13e

Please sign in to comment.