Merge pull request #33 from lynnlo/styling-cities · codeday/present@cd8ae32 · GitHub
Skip to content

Commit cd8ae32

Browse files
authored
Merge pull request #33 from lynnlo/styling-cities
Added Styling to City Links
2 parents ac4233a + 4fd02ac commit cd8ae32

5 files changed

Lines changed: 68 additions & 8 deletions

File tree

‎.babelrc‎

Lines changed: 1 addition & 0 deletions

‎components/cities.js‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import Link from 'next/link';
4+
import styled from 'styled-components';
5+
6+
const CityDiv = styled.div`
7+
display: flex;
8+
flex-direction: column;
9+
justify-content: center;
10+
align-items: center;
11+
background-color: #ff686b;
12+
border: 1px solid #e6e6e6;
13+
border-radius: 3px;
14+
box-shadow: 0 4px 4px rgba(0,0,0,0.5);
15+
padding: 30px;
16+
cursor: pointer;
17+
transition: filter 0.2s ease-in-out;
18+
19+
&:hover {
20+
filter: brightness(1.2);
21+
}
22+
23+
&:active {
24+
filter: brightness(0.8);
25+
}
26+
`;
27+
28+
export default class Cities extends React.Component {
29+
static propTypes = {
30+
href: PropTypes.string.isRequired,
31+
city_event: PropTypes.object.isRequired,
32+
}
33+
34+
constructor(props) {
35+
super(props);
36+
}
37+
38+
render() {
39+
const { href, city_event } = this.props;
40+
41+
return (
42+
<CityDiv onClick={()=> {window.location = href}}>
43+
<h3> {city_event.name} </h3>
44+
</CityDiv>
45+
);
46+
}
47+
}

‎next.config.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ module.exports = {
1111

1212
return config;
1313
},
14+
compiler: {
15+
styledComponents: true
16+
},
1417
port: 8001,
1518
};

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
6+
"dev": "NODE_OPTIONS=--openssl-legacy-provider next dev",
7+
"build": "NODE_OPTIONS=--openssl-legacy-provider next build",
88
"start": "NODE_ENV=production node server.js"
99
},
1010
"dependencies": {

‎pages/index.js‎

Lines changed: 15 additions & 6 deletions

0 commit comments

Comments
 (0)