Skip to content

Commit 93fc8e1

Browse files
committed
Allow self picking
1 parent 1da9caa commit 93fc8e1

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/App.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function App() {
3030
key={i}
3131
srcObject={blob}
3232
picked={picked.includes(blob)}
33-
onPick={() => setPicked((prev) => toggle(prev, blob))}
33+
onPick={() => setPicked((prev) => [blob, ...prev])}
3434
/>
3535
))}
3636
</>
@@ -39,10 +39,4 @@ function App() {
3939
);
4040
}
4141

42-
function toggle<T>(list: T[], item: T): T[] {
43-
return list.includes(item)
44-
? list.filter((each) => each !== item)
45-
: [...list, item];
46-
}
47-
4842
export default App;

src/index.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ a:hover {
2525
body {
2626
margin: 0;
2727
display: flex;
28-
place-items: center;
2928
min-width: 320px;
3029
min-height: 100vh;
3130
}
3231

3332
h1 {
3433
font-size: 3.2em;
3534
line-height: 1.1;
35+
font-weight: 100;
36+
}
37+
h2,
38+
h3,
39+
h4 {
40+
font-weight: 100;
3641
}
3742

3843
button {

0 commit comments

Comments
 (0)