Skip to content

Commit 1d28566

Browse files
committed
adding a contact form
1 parent eeefe54 commit 1d28566

File tree

9 files changed

+128
-69
lines changed

9 files changed

+128
-69
lines changed

prerender-urls.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const fs = require('fs');
55
const [blogs, images] = generateFileList(join(__dirname, 'content')).nodes;
66
module.exports = () => {
77
const pages = [
8-
{ url: '/' }
8+
{ url: '/' },
9+
{ url: '/contact/' }
910
];
1011

1112
// adding blogs list posts page
@@ -26,11 +27,5 @@ module.exports = () => {
2627
};
2728
}));
2829

29-
30-
pages.push({
31-
url: '/photography/',
32-
data: images
33-
});
34-
3530
return pages;
3631
};

src/components/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Header from './header';
77
import Home from '../routes/home';
88
import Blogs from '../routes/blogs';
99
import Blog from '../routes/blog';
10-
import Photographs from '../routes/photographs';
10+
import Contact from '../routes/contact';
1111

1212
export default class App extends Component {
1313

@@ -28,7 +28,7 @@ export default class App extends Component {
2828
<Home path="/" />
2929
<Blogs path="/blogs/" />
3030
<Blog path="/blog/:name" />
31-
<Photographs path="/photography/" />
31+
<Contact path="/contact/" />
3232
</Router>
3333
</div>
3434
</Provider>

src/components/header/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Header = () => (
77
<Link href="/"><h1>Jane Doe</h1></Link>
88
<nav>
99
<Link activeClassName={style.active} href="/blogs">Blogs</Link>
10-
<Link activeClassName={style.active} href="/photography">Photography</Link>
10+
<Link activeClassName={style.active} href="/contact">Contact me</Link>
1111
</nav>
1212
</header>
1313
);

src/routes/blog/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
max-width: 100%;
2020
}
2121

22+
.blogbody code {
23+
max-width: 100%;
24+
overflow: scroll;
25+
}
26+
2227
.blogsubtitle {
2328
color: #aaa;
2429
display: block;

src/routes/contact/index.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { h } from 'preact';
2+
import style from './style';
3+
4+
const photographs = (props) => {
5+
return (
6+
<div class={style.pageContact}>
7+
<h1 class={style.pageTitle}>Contact me</h1>
8+
<div class={style.formWrapper}>
9+
<p class={style.pageBody}>
10+
<div>Hi!</div>
11+
<div>If you are interested in my work and are looking to contact me for a contract please use the following form to contact me.</div>
12+
<div>&nbsp;</div>
13+
<div>Cheers 🍻</div>
14+
</p>
15+
<form name="contact" method="POST" data-netlify="true">
16+
<p>
17+
<input type="text" name="name" placeholder="Name" required />
18+
</p>
19+
<p>
20+
<input type="email" name="email" placeholder="E-Mail" required />
21+
</p>
22+
<p>
23+
<textarea name="message" placeholder="Message" />
24+
</p>
25+
<p>
26+
<button type="submit">Send</button>
27+
</p>
28+
</form>
29+
</div>
30+
</div>
31+
);
32+
};
33+
34+
export default photographs;

src/routes/contact/style.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.pageContact {
2+
padding: 0 5%;
3+
}
4+
5+
.pageTitle {
6+
position: relative;
7+
display: inline-block;
8+
font-weight: 500;
9+
}
10+
11+
.pageTitle:after {
12+
position: absolute;
13+
bottom: -5px;
14+
left: 0px;
15+
content: '';
16+
width: 75%;
17+
border-bottom: 2px solid #FFC107;
18+
}
19+
20+
.pageBody {
21+
font-size: 1.2rem;
22+
flex: 1;
23+
}
24+
25+
.pageContact input, .pageContact textarea {
26+
width: 100%;
27+
font-size: 1.1rem;
28+
padding: 8px;
29+
border: 1px solid #999;
30+
}
31+
32+
.pageContact .formWrapper {
33+
display: flex;
34+
flex-direction: row;
35+
}
36+
37+
.pageContact form {
38+
flex: 1;
39+
}
40+
41+
.pageContact button {
42+
padding: 8px;
43+
font-size: 1rem;
44+
border-radius: 5px;
45+
}

src/routes/photographs/index.js

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

src/routes/photographs/style.css

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

yarn.lock

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,7 @@ date-now@^0.1.4:
30413041
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
30423042
integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=
30433043

3044-
[email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9:
3044+
[email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8, debug@^2.6.9:
30453045
version "2.6.9"
30463046
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
30473047
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
@@ -4844,7 +4844,7 @@ internal-ip@^4.3.0:
48444844
default-gateway "^4.2.0"
48454845
ipaddr.js "^1.9.0"
48464846

4847-
invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4:
4847+
invariant@^2.0.0, invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4:
48484848
version "2.2.4"
48494849
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
48504850
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
@@ -6039,6 +6039,11 @@ load-json-file@^4.0.0:
60396039
pify "^3.0.0"
60406040
strip-bom "^3.0.0"
60416041

6042+
load-script@^1.0.0:
6043+
version "1.0.0"
6044+
resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4"
6045+
integrity sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ=
6046+
60426047
loader-runner@^2.4.0:
60436048
version "2.4.0"
60446049
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357"
@@ -7969,7 +7974,7 @@ prompts@^2.2.1:
79697974
kleur "^3.0.3"
79707975
sisteransi "^1.0.3"
79717976

7972-
prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
7977+
prop-types@^15.5.3, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
79737978
version "15.7.2"
79747979
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
79757980
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -8167,6 +8172,14 @@ react-hot-loader@^4.12.9:
81678172
shallowequal "^1.1.0"
81688173
source-map "^0.7.3"
81698174

8175+
react-intersection-observer@^8.24.2:
8176+
version "8.24.2"
8177+
resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-8.24.2.tgz#e4c2474aed39b0962fcde68ba3c12c3c05d28988"
8178+
integrity sha512-1l3eS/vZ3ScS6xawgeysl2z5hCtzJ2o4eYyQu4VdrbaahcWJccphPmZmQvFRsHA1tyKpMYV+KCrKfhuN5w8Erw==
8179+
dependencies:
8180+
"@babel/runtime" "^7.0.0"
8181+
invariant "^2.0.0"
8182+
81708183
react-is@^16.7.0, react-is@^16.8.1:
81718184
version "16.9.0"
81728185
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
@@ -8177,6 +8190,15 @@ react-lifecycles-compat@^3.0.4:
81778190
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
81788191
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
81798192

8193+
react-youtube@^7.9.0:
8194+
version "7.9.0"
8195+
resolved "https://registry.yarnpkg.com/react-youtube/-/react-youtube-7.9.0.tgz#cf513c253581e1e45aa412a77d03420dfd7f7ba7"
8196+
integrity sha512-2+nBF4qP8nStYEILIO1/SylKOCnnJUxuZm+qCeWA0eeZxnWZIIixfAeAqbzblwx5L1n/26ACocy3epm9Glox8w==
8197+
dependencies:
8198+
fast-deep-equal "^2.0.1"
8199+
prop-types "^15.5.3"
8200+
youtube-player "^5.5.1"
8201+
81808202
read-pkg-up@^1.0.1:
81818203
version "1.0.1"
81828204
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
@@ -8836,6 +8858,11 @@ simple-swizzle@^0.2.2:
88368858
dependencies:
88378859
is-arrayish "^0.3.1"
88388860

8861+
sister@^3.0.0:
8862+
version "3.0.2"
8863+
resolved "https://registry.yarnpkg.com/sister/-/sister-3.0.2.tgz#bb3e39f07b1f75bbe1945f29a27ff1e5a2f26be4"
8864+
integrity sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==
8865+
88398866
sisteransi@^1.0.3:
88408867
version "1.0.3"
88418868
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.3.tgz#98168d62b79e3a5e758e27ae63c4a053d748f4eb"
@@ -10420,3 +10447,12 @@ yargs@^9.0.0:
1042010447
which-module "^2.0.0"
1042110448
y18n "^3.2.1"
1042210449
yargs-parser "^7.0.0"
10450+
10451+
youtube-player@^5.5.1:
10452+
version "5.5.2"
10453+
resolved "https://registry.yarnpkg.com/youtube-player/-/youtube-player-5.5.2.tgz#052b86b1eabe21ff331095ffffeae285fa7f7cb5"
10454+
integrity sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==
10455+
dependencies:
10456+
debug "^2.6.6"
10457+
load-script "^1.0.0"
10458+
sister "^3.0.0"

0 commit comments

Comments
 (0)