Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3f0903e

Browse files
Add a reset button (#120)
* add reset button ✨ * remove checked, difficultyCount from React.useMemo
1 parent 810c859 commit 3f0903e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

‎src/components/Table/index.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Row,
77
Badge,
88
NavLink,
9+
Button,
910
} from 'reactstrap';
1011
import Toggle from 'react-toggle';
1112
import ReactTooltip from 'react-tooltip';
@@ -132,6 +133,19 @@ const Table = () => {
132133
Hard: {difficultyCount.Hard}/{totalDifficultyCount.Hard}
133134
</span>
134135
</Badge>
136+
<br />
137+
<Button
138+
className="reset-button"
139+
outline
140+
size="sm"
141+
color="danger"
142+
onClick={() => {
143+
setDifficultyCount({ Easy: 0, Medium: 0, Hard: 0 });
144+
setChecked([...checked].map(() => false));
145+
}}
146+
>
147+
Reset
148+
</Button>
135149
</span>
136150
);
137151
},

‎src/components/Table/styles.scss‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@
4040
.companies img {
4141
padding: 5px;
4242
}
43-
43+
4444
.react-toggle {
4545
top: 7px;
4646
}
47+
48+
.reset-button {
49+
margin-top: 10px;
50+
font-size: 0.7rem;
51+
}
4752
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /