Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Commit 5be97d1

Browse files
committed
Merge branch 'renovate/node-16.x' of github.com:codecoolture/tddworkshop.com into renovate/node-16.x
2 parents d6ebe1c + c712254 commit 5be97d1

13 files changed

Lines changed: 1305 additions & 2250 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v2
8-
- uses: actions/setup-node@v2
8+
- uses: actions/setup-node@v3
99
with:
1010
node-version: "16.13.1"
1111
cache: "yarn"
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v2
19-
- uses: actions/setup-node@v2
19+
- uses: actions/setup-node@v3
2020
with:
2121
node-version: "16.13.1"
2222
cache: "yarn"
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v2
30-
- uses: actions/setup-node@v2
30+
- uses: actions/setup-node@v3
3131
with:
3232
node-version: "16.13.1"
3333
cache: "yarn"

components/Email/index.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { useCallback, useEffect, useState } from "react";
2+
import { FaRegCopy } from "react-icons/fa";
3+
import { Tooltip } from "react-tooltip";
4+
5+
type EmailProps = {
6+
children: string;
7+
onCopyTooltip: string;
8+
};
9+
10+
export function Email({ children, onCopyTooltip }: EmailProps) {
11+
const [copied, setCopied] = useState(false);
12+
const [id, setId] = useState("");
13+
14+
const handleCopy = useCallback(() => {
15+
navigator.clipboard.writeText(children);
16+
17+
setCopied(true);
18+
}, [children]);
19+
20+
useEffect(() => {
21+
if (!copied) return;
22+
23+
const timeout = setTimeout(() => setCopied(false), 2000);
24+
25+
return () => clearTimeout(timeout);
26+
}, [copied]);
27+
28+
useEffect(() => {
29+
setId(Math.random().toString(36).substring(7));
30+
}, []);
31+
32+
return (
33+
<button className="Email" onClick={handleCopy} id={id}>
34+
{children}
35+
36+
<span className="Email__Icon">
37+
<FaRegCopy />
38+
</span>
39+
40+
<Tooltip anchorId={id} isOpen={copied} place="bottom" className="Email__Tooltip">
41+
{onCopyTooltip}
42+
</Tooltip>
43+
</button>
44+
);
45+
}

components/Email/style.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.Email {
2+
align-items: baseline;
3+
border: 1px dashed var(--gray7);
4+
display: inline-flex;
5+
font-size: 1em;
6+
padding: 0 0.15rem;
7+
8+
color: var(--gray11);
9+
cursor: pointer;
10+
background-color: transparent;
11+
border-radius: 0.25rem;
12+
font-family: inherit;
13+
font-weight: 700;
14+
15+
appearance: none;
16+
17+
transition: border-color 250ms ease-in-out, color 250ms ease-in-out;
18+
}
19+
20+
.Email:hover {
21+
border-color: var(--gray8);
22+
color: var(--gray12);
23+
}
24+
25+
.Email__Icon {
26+
font-size: 0.65em;
27+
margin-left: 0.25rem;
28+
}
29+
30+
.Email .Email__Tooltip {
31+
font-size: 0.65em;
32+
33+
background-color: var(--gray3);
34+
color: var(--gray12);
35+
}

layouts/Page/components/ContactForm/Field.tsx

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

layouts/Page/components/ContactForm/index.tsx

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

layouts/Page/components/ContactForm/style.css

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

layouts/Page/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ContactForm } from "./components/ContactForm";
21
import { Footer } from "./components/Footer";
32
import { Header } from "./components/Header";
43
import { Heading } from "./components/Heading";
@@ -16,8 +15,6 @@ export function Page({ children }: PageProps) {
1615

1716
Page.Header = Header;
1817

19-
Page.ContactForm = ContactForm;
20-
2118
Page.Footer = Footer;
2219

2320
Page.Heading = Heading;

package.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,29 @@
77
"dependencies": {
88
"@radix-ui/colors": "0.1.8",
99
"fathom-client": "3.5.0",
10-
"formik": "2.2.9",
1110
"next": "12.0.8",
1211
"react": "18.2.0",
1312
"react-dom": "18.2.0",
14-
"react-hot-toast": "2.3.0",
15-
"react-icons": "4.4.0",
16-
"sharp": "0.30.7",
13+
"react-icons": "4.7.1",
14+
"react-tooltip": "5.7.4",
1715
"yup": "0.32.11"
1816
},
1917
"devDependencies": {
20-
"@netlify/plugin-nextjs": "4.2.1",
2118
"@next/eslint-plugin-next": "12.0.8",
22-
"@testing-library/cypress": "8.0.3",
19+
"@testing-library/cypress": "8.0.7",
2320
"@types/jest": "27.5.2",
2421
"@types/react": "17.0.47",
25-
"@types/react-dom": "17.0.17",
26-
"@typescript-eslint/eslint-plugin": "5.31.0",
27-
"@typescript-eslint/parser": "5.31.0",
22+
"@types/react-dom": "17.0.18",
23+
"@typescript-eslint/eslint-plugin": "5.50.0",
24+
"@typescript-eslint/parser": "5.50.0",
2825
"cypress": "9.7.0",
29-
"eslint": "8.20.0",
30-
"eslint-config-prettier": "8.5.0",
26+
"eslint": "8.33.0",
27+
"eslint-config-prettier": "8.6.0",
3128
"eslint-plugin-prettier": "4.2.1",
3229
"jest": "27.5.1",
33-
"prettier": "2.7.1",
34-
"start-server-and-test": "1.14.0",
35-
"typescript": "4.7.4"
30+
"prettier": "2.8.3",
31+
"start-server-and-test": "1.15.3",
32+
"typescript": "4.9.5"
3633
},
3734
"scripts": {
3835
"analyze": "yarn typecheck && yarn lint",

pages/_app.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { AppProps } from "next/app";
22
import Head from "next/head";
33
import React from "react";
4-
import { Toaster } from "react-hot-toast";
54
import { useFathom } from "../hooks";
65
import "../styles/index.css";
76

@@ -21,8 +20,6 @@ export default function MyApp({ Component, pageProps }: AppProps) {
2120
</Head>
2221

2322
<Component {...pageProps} />
24-
25-
<Toaster />
2623
</React.Fragment>
2724
);
2825
}

pages/en/index.tsx

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FaGithub, FaLinkedin, FaTwitter } from "react-icons/fa";
2+
import { Email } from "../../components/Email";
23
import { Figure } from "../../components/Figure";
34
import { Link } from "../../components/Link";
45
import { List } from "../../components/List";
@@ -134,9 +135,12 @@ export default function Homepage() {
134135
product teams at different startups.
135136
</Page.Text>
136137

138+
<Page.Subheading>Contact</Page.Subheading>
139+
137140
<Page.Text>
138-
If you would like to hire this technical training, please use the form below or drop me a line at
139-
hola@codecoolture.com.
141+
Would you like to hire this technical training? Please drop me a line at{" "}
142+
<Email onCopyTooltip="Email copied to clipboard">hola@codecoolture.com</Email> and tell me about your team
143+
and the projects you are working on!
140144
</Page.Text>
141145

142146
<Page.Subheading>Published material</Page.Subheading>
@@ -164,33 +168,6 @@ export default function Homepage() {
164168
: Template to (deliberate) practice your test-driven development skills.
165169
</List.Item>
166170
</List>
167-
168-
<Page.Subheading>Contact</Page.Subheading>
169-
170-
<Page.ContactForm onSuccessMessage="Thank you! I will respond to you promptly.">
171-
<Page.ContactForm.Field name="email">
172-
<Page.ContactForm.Field.Label>Your email</Page.ContactForm.Field.Label>
173-
174-
<Page.ContactForm.Field.Hint>Use an email where you want to receive my reply</Page.ContactForm.Field.Hint>
175-
176-
<Page.ContactForm.Field.Input />
177-
178-
<Page.ContactForm.Field.Error>Please, use a valid email.</Page.ContactForm.Field.Error>
179-
</Page.ContactForm.Field>
180-
181-
<Page.ContactForm.Field name="message">
182-
<Page.ContactForm.Field.Label>Your message</Page.ContactForm.Field.Label>
183-
184-
<Page.ContactForm.Field.Hint>
185-
This is <strong>optional</strong>. You may use it to ask for more information, tell me about your
186-
project, or say hi :-)
187-
</Page.ContactForm.Field.Hint>
188-
189-
<Page.ContactForm.Field.TextArea numberOfRows={5} />
190-
</Page.ContactForm.Field>
191-
192-
<Page.ContactForm.Submit>Send your message</Page.ContactForm.Submit>
193-
</Page.ContactForm>
194171
</Page.Row>
195172
</Page.Main>
196173

0 commit comments

Comments
 (0)