Skip to content

Commit a07a4ae

Browse files
committed
setting the collection.styles.jsx
1 parent aec8206 commit a07a4ae

File tree

7 files changed

+102
-82
lines changed

7 files changed

+102
-82
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import React from "react";
2-
import './custom-button.styles.scss'
32

4-
const CustomButtonComponent = ({ children, isGoogleSignIn, inverted ,...otherProps }) => (
5-
<button
6-
className={`${inverted ? 'inverted' : '' }${isGoogleSignIn ? 'google-sign-in' : ''} custom-button`}
7-
{...otherProps}
8-
>
3+
import { CustomButtonContainer } from "./custom-button.styles";
4+
5+
const CustomButtonComponent = ({ children, ...props }) => (
6+
<CustomButtonContainer {...props} >
97
{children}
10-
</button>
8+
</CustomButtonContainer>
119
)
1210

1311
export default CustomButtonComponent
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import styled, { css } from "styled-components"
2+
3+
const buttonStyles = css`
4+
background-color: black;
5+
color:white;
6+
border: none;
7+
8+
&:hover {
9+
background-color: white;
10+
color: black;
11+
border: 1px solid black;
12+
}
13+
`
14+
15+
const invertedButtonStyles = css`
16+
background-color: white;
17+
color: black;
18+
border: 1px solid black;
19+
20+
&:hover {
21+
background-color: black;
22+
color: white;
23+
border: none;
24+
}
25+
`
26+
const googleSignInStyles = css `
27+
background-color: #4285f4;
28+
color: white;
29+
30+
&:hover {
31+
background-color: #357ae8;
32+
border: none;
33+
}
34+
`
35+
36+
const getButtonStyles = props => {
37+
if (props.isGoogleSignIn){
38+
return googleSignInStyles;
39+
}
40+
41+
return props.inverted ? invertedButtonStyles : buttonStyles
42+
}
43+
44+
export const CustomButtonContainer = styled.button`
45+
min-width: 165px;
46+
width: auto;
47+
height: 50px;
48+
letter-spacing: 0.5px;
49+
line-height: 50px;
50+
padding: 0 35px 0 35px;
51+
font-size: 15px;
52+
background-color: black;
53+
color: white;
54+
text-transform: uppercase;
55+
font-family: 'Open Sans Condensed', sans-serif;
56+
font-weight: bolder;
57+
cursor: pointer;
58+
display: flex;
59+
justify-content: center;
60+
61+
62+
${getButtonStyles}
63+
`
Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +0,0 @@
1-
.custom-button {
2-
min-width: 165px;
3-
width: auto;
4-
height: 50px;
5-
letter-spacing: 0.5px;
6-
line-height: 50px;
7-
padding: 0 35px 0 35px;
8-
font-size: 15px;
9-
background-color: black;
10-
color: white;
11-
text-transform: uppercase;
12-
font-family: 'Open Sans Condensed', sans-serif;
13-
font-weight: bolder;
14-
border: none;
15-
cursor: pointer;
16-
display: flex;
17-
justify-content: center;
18-
19-
20-
&:hover {
21-
background-color: white;
22-
color: black;
23-
border: 1px solid black;
24-
}
25-
&.google-sign-in{
26-
background-color: #4285f4;
27-
color: white;
28-
29-
30-
&:hover{
31-
background-color: #357ae8;
32-
border: none;
33-
}
34-
}
35-
36-
&.inverted {
37-
background-color: white;
38-
color: black;
39-
border: 1px solid black;
40-
41-
&:hover {
42-
background-color: black;
43-
color: white;
44-
border: none;
45-
}
46-
}
47-
}

src/components/header/header.styles.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Link } from "react-router-dom";
33

44

55
const OptionConstainerStyles = css`
6-
padding: 10px 15px;
7-
cursor: pointer;
6+
padding: 15px 15px;
7+
cursor: pointer;
88
99
`;
1010

src/pages/collection/collection.component.jsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ import CollectionItem from '../../components/collection-item/collection-item.com
55

66
import { selectCollection } from '../../redux/shop/shop.selectors';
77

8-
import './collection.styles.scss';
8+
import {
9+
CollectionTitle,
10+
CollectionPageContainer,
11+
CollectionItemsContainer
12+
} from "./collection.styles";
913

1014
const CollectionPage = ({ collection }) => {
1115
const { title, items } = collection
1216

1317
return (
14-
<div className='collection-page'>
15-
<h2 className='title'>{title}</h2>
16-
<div className='items'>
18+
<CollectionPageContainer>
19+
<CollectionTitle>{title}</CollectionTitle>
20+
<CollectionItemsContainer>
1721
{items.map(item => (
1822
<CollectionItem key={item.id} item={item} />
1923
))}
20-
</div>
21-
</div>
24+
</CollectionItemsContainer>
25+
</CollectionPageContainer>
2226
);
2327
};
2428

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import styled from 'styled-components'
2+
3+
export const CollectionPageContainer = styled.div`
4+
display: flex;
5+
flex-direction: column;
6+
`
7+
8+
export const CollectionTitle = styled.h2`
9+
font-size: 38px;
10+
margin: 0 auto 30px;
11+
`
12+
13+
export const CollectionItemsContainer = styled.div`
14+
display: grid;
15+
grid-template-columns: 1fr 1fr 1fr 1fr;
16+
grid-gap: 10px;
17+
18+
& > div {
19+
margin-bottom: 30px;
20+
}
21+
`
22+

src/pages/collection/collection.styles.scss

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)