Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe1d8d9

Browse files
committedDec 16, 2021
Rename test to template, switch to functional components
1 parent 9aba8e6 commit fe1d8d9

12 files changed

+56
-138
lines changed
 
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"name": "@stanlemon/app-test",
2+
"name": "@stanlemon/app-template",
3+
"version": "0.1.0",
4+
"description": "A template for creating apps using the webdev package.",
5+
"author": "Stan Lemon <stanlemon@users.noreply.github.com>",
6+
"license": "MIT",
37
"type": "module",
48
"scripts": {
59
"start": "webpack serve",
@@ -9,9 +13,6 @@
913
"lint:format": "eslint --fix --ext js,jsx,ts,tsx ./src/"
1014
},
1115
"dependencies": {
12-
"@fortawesome/fontawesome-svg-core": "^1.2.36",
13-
"@fortawesome/free-solid-svg-icons": "^5.15.4",
14-
"@fortawesome/react-fontawesome": "^0.1.16",
1516
"@stanlemon/webdev": "*"
1617
}
17-
}
18+
}

‎apps/template/src/App.less

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@primaryFont: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
2+
3+
body {
4+
font-family: @primaryFont;
5+
}
File renamed without changes.

‎apps/template/src/App.tsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React, { useState } from "react";
2+
import "./App.less";
3+
4+
function Input({ onClick }) {
5+
const [value, setValue] = useState("");
6+
7+
const handleClick = () => {
8+
onClick(value);
9+
setValue("");
10+
};
11+
12+
return (
13+
<>
14+
<input
15+
type="text"
16+
onChange={(e) => setValue(e.currentTarget.value)}
17+
value={value}
18+
/>
19+
<button onClick={handleClick}>Add</button>
20+
</>
21+
);
22+
}
23+
24+
export default function App() {
25+
const [items, setItems] = useState([]);
26+
return (
27+
<div>
28+
<h1>Hello World!</h1>
29+
<Input onClick={(item) => setItems([...items, item])} />
30+
<ul>
31+
{items.map((item, i) => (
32+
<li key={i}>{item}</li>
33+
))}
34+
</ul>
35+
</div>
36+
);
37+
}
File renamed without changes.
File renamed without changes.

‎apps/test/src/App.less

-5
This file was deleted.

‎apps/test/src/App.tsx

-44
This file was deleted.

‎package-lock.json

+8-84
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.