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

Appearance settings

Commit 3f0903e

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

File tree

Expand file treeCollapse file tree

2 files changed

+20
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+20
-1
lines changed

‎src/components/Table/index.js

Copy file name to clipboardExpand all lines: src/components/Table/index.js
+14Lines 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

Copy file name to clipboardExpand all lines: src/components/Table/styles.scss
+6-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.