Skip to content

Commit e1c70ce

Browse files
committed
Prettier
1 parent a0ed4ad commit e1c70ce

File tree

10 files changed

+1616
-975
lines changed

10 files changed

+1616
-975
lines changed

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
UID=$(shell id -u)
2+
GID=$(shell id -g)
3+
14
serve:
25
docker container run --rm -it \
36
-v $(PWD):/website \
@@ -31,6 +34,7 @@ ui:
3134
ui-dev:
3235
docker container run --rm -it \
3336
-v $(PWD)/ui:/usr/src/app \
37+
-u $(UID):$(GID) \
3438
-w /usr/src/app \
3539
-p 3000:3000 \
3640
--net=host \
@@ -50,6 +54,7 @@ node:
5054
docker container run --rm -it \
5155
-v $(PWD):/usr/src/app \
5256
-w /usr/src/app \
57+
-u $(UID):$(GID) \
5358
node \
5459
bash
5560

@@ -61,4 +66,12 @@ deploy:
6166
google/cloud-sdk \
6267
python /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py -A gold-summer-17 --noauth_local_webserver update .
6368

69+
prettier:
70+
docker run -it --rm \
71+
-v "$(PWD)"/ui:/usr/src/app \
72+
-w /usr/src/app \
73+
-u $(UID):$(GID) \
74+
node:latest \
75+
sh -c "node node_modules/prettier/bin-prettier.js --write src/**/*.js"
76+
6477
.PHONY: ui pdfgen

ui/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"proxy": "http://localhost:8080",
66
"devDependencies": {
7+
"prettier": "^1.15.3",
78
"react-scripts": "^2.1.3"
89
},
910
"dependencies": {

ui/src/components/About/index.js

+61-50
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,69 @@
11
/* global google */
2-
import React, { Component } from 'react';
2+
import React, { Component } from "react";
33

4-
import './About.css';
4+
import "./About.css";
55

66
export default class About extends Component {
7-
componentDidMount() {
8-
let mapOptions = {
9-
zoom: 2,
10-
scrollwheel: false,
11-
center: new google.maps.LatLng(32.937960, -1.453884)
12-
};
13-
let map = new google.maps.Map(this.refs.mapCanvas, mapOptions);
7+
componentDidMount() {
8+
let mapOptions = {
9+
zoom: 2,
10+
scrollwheel: false,
11+
center: new google.maps.LatLng(32.93796, -1.453884)
12+
};
13+
let map = new google.maps.Map(this.refs.mapCanvas, mapOptions);
1414

15-
fetch('/api/location', { headers: new Headers({ accept: 'application/json' }) })
16-
.then(resp => resp.json())
17-
.then(places => {
18-
for (let place of places) {
19-
new google.maps.Marker({
20-
position: place,
21-
map: map,
22-
title: place.name
23-
});
24-
}
25-
});
15+
fetch("/api/location", {
16+
headers: new Headers({ accept: "application/json" })
17+
})
18+
.then(resp => resp.json())
19+
.then(places => {
20+
for (let place of places) {
21+
new google.maps.Marker({
22+
position: place,
23+
map: map,
24+
title: place.name
25+
});
26+
}
27+
});
2628

27-
setInterval(() => {
28-
document.getElementById('framed').src = 'https://framed.joshchorlton.com/api/photo/dd91d6?' + new Date().getTime()
29-
}, 10000);
30-
}
29+
setInterval(() => {
30+
document.getElementById("framed").src =
31+
"https://framed.joshchorlton.com/api/photo/dd91d6?" +
32+
new Date().getTime();
33+
}, 10000);
34+
}
3135

32-
render() {
33-
return (
34-
<div id="about" className="noPrint">
35-
<div id="aboutContent">
36-
<h1 className="sectionHeading">
37-
About Me
38-
</h1>
39-
<p>
40-
I'm currently employed as a Software Engineer at Stripe. I studied at the University of Waterloo in Canada. I've been around the world for school, work and pleasure.
41-
</p>
42-
<p>
43-
I grew up in Toronto, Ontario where I completed elementary and high school. Growing up, I was an avid hockey fan. I particularly enjoy playing outdoor games in the winter.
44-
</p>
45-
<p>
46-
I also love to travel. I've been to a few different continents and met some really cool people along the way. My travels have brought me on trips ranging from African safari to remote villages in Vietnam to beach parties in the Philippines. Check out the places I've been to on the map.
47-
</p>
48-
<div id="map" ref="mapCanvas"></div>
49-
<p>
50-
Here are some of my favourite photos from these trips:
51-
</p>
52-
<img id="framed" src="https://framed.joshchorlton.com/api/photo/93b34e" alt="Travel" />
53-
</div>
54-
</div>
55-
);
56-
}
36+
render() {
37+
return (
38+
<div id="about" className="noPrint">
39+
<div id="aboutContent">
40+
<h1 className="sectionHeading">About Me</h1>
41+
<p>
42+
I'm currently employed as a Software Engineer at Stripe. I studied
43+
at the University of Waterloo in Canada. I've been around the world
44+
for school, work and pleasure.
45+
</p>
46+
<p>
47+
I grew up in Toronto, Ontario where I completed elementary and high
48+
school. Growing up, I was an avid hockey fan. I particularly enjoy
49+
playing outdoor games in the winter.
50+
</p>
51+
<p>
52+
I also love to travel. I've been to a few different continents and
53+
met some really cool people along the way. My travels have brought
54+
me on trips ranging from African safari to remote villages in
55+
Vietnam to beach parties in the Philippines. Check out the places
56+
I've been to on the map.
57+
</p>
58+
<div id="map" ref="mapCanvas" />
59+
<p>Here are some of my favourite photos from these trips:</p>
60+
<img
61+
id="framed"
62+
src="https://framed.joshchorlton.com/api/photo/93b34e"
63+
alt="Travel"
64+
/>
65+
</div>
66+
</div>
67+
);
68+
}
5769
}
58-

ui/src/components/App/index.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import React, { Component } from 'react';
1+
import React, { Component } from "react";
22

3-
import Nav from '../Nav';
4-
import Home from '../Home';
5-
import Resume from '../Resume';
6-
import Projects from '../Projects';
7-
import About from '../About';
8-
import './App.css';
3+
import Nav from "../Nav";
4+
import Home from "../Home";
5+
import Resume from "../Resume";
6+
import Projects from "../Projects";
7+
import About from "../About";
8+
import "./App.css";
99

1010
export default class App extends Component {
11-
render() {
12-
return (
13-
<div>
14-
<Nav />
15-
<Home />
16-
<Resume />
17-
<Projects />
18-
<About />
19-
</div>
20-
);
21-
}
11+
render() {
12+
return (
13+
<div>
14+
<Nav />
15+
<Home />
16+
<Resume />
17+
<Projects />
18+
<About />
19+
</div>
20+
);
21+
}
2222
}

0 commit comments

Comments
 (0)