Skip to content

Commit 6cdd89f

Browse files
Cleanup
1 parent fac206e commit 6cdd89f

10 files changed

+35
-162
lines changed

components/button.module.css

-57
This file was deleted.

components/button.tsx

-29
This file was deleted.

components/demo/heading.module.css

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.title {
2+
color: dodgerblue;
3+
font-weight: 100;
4+
}

components/demo/heading.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import styles from "./heading.module.css";
2+
3+
export function Heading() {
4+
return <h1 className={styles.title}>Page title</h1>;
5+
}

components/demo/product.module.css

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.title {
2+
color: deeppink;
3+
font-weight: 900;
4+
}

components/demo/product.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import styles from "./product.module.css";
2+
3+
export function Product() {
4+
return (
5+
<div>
6+
<h2 className={styles.title}>Product title</h2>
7+
</div>
8+
);
9+
}

components/input.tsx

-25
This file was deleted.

pages/demo.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Heading } from "../components/demo/heading";
2+
import { Product } from "../components/demo/product";
3+
4+
export default function Page() {
5+
return (
6+
<main>
7+
<Heading />
8+
<Product />
9+
</main>
10+
);
11+
}

pages/index.tsx

+2-26
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
import { useState } from "react";
2-
import Link from "next/link";
3-
import { Button } from "../components/button";
4-
import { Input } from "../components/input";
5-
6-
export default function Home() {
7-
const [showButtons, toggleButtons] = useState(false);
8-
const [width, setWidth] = useState(100);
9-
1+
export default function Page() {
102
return (
113
<main>
12-
<Link href="/other" prefetch={false}>
13-
<a>Other page</a>
14-
</Link>
15-
16-
<Button color="blue" onClick={() => toggleButtons(true)}>
17-
Show other buttons
18-
</Button>
19-
20-
{showButtons && (
21-
<>
22-
<Button color="yellow">Yellow button</Button>
23-
<Button color="green">Green button</Button>
24-
<Button color="red">Red button</Button>
25-
</>
26-
)}
27-
28-
<Input value={width} onChange={(val) => setWidth(val)} />
4+
<h1>Index page</h1>
295
</main>
306
);
317
}

pages/other.tsx

-25
This file was deleted.

0 commit comments

Comments
 (0)