Skip to content

Commit 66d5241

Browse files
committed
fix: the text for each Button now displays
1 parent 64c3b0d commit 66d5241

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

trekbag/final-code/src/components/ButtonGroup.jsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
1-
import { useItemsStore } from "../stores/itemsStore";
2-
import Button from "./Button";
1+
import { useItemsStore } from '../stores/itemsStore';
2+
import Button from './Button';
33

44
export default function ButtonGroup() {
55
const markAllAsComplete = useItemsStore((state) => state.markAllAsComplete);
6-
const markAllAsIncomplete = useItemsStore(
7-
(state) => state.markAllAsIncomplete
8-
);
6+
const markAllAsIncomplete = useItemsStore((state) => state.markAllAsIncomplete);
97
const resetToInitial = useItemsStore((state) => state.resetToInitial);
108
const removeAllItems = useItemsStore((state) => state.removeAllItems);
119

1210
const secondaryButtons = [
1311
{
14-
text: "Mark all as complete",
12+
text: 'Mark all as complete',
1513
onClick: markAllAsComplete,
1614
},
1715
{
18-
text: "Mark all as incomplete",
16+
text: 'Mark all as incomplete',
1917
onClick: markAllAsIncomplete,
2018
},
2119
{
22-
text: "Reset to initial",
20+
text: 'Reset to initial',
2321
onClick: resetToInitial,
2422
},
2523
{
26-
text: "Remove all items",
24+
text: 'Remove all items',
2725
onClick: removeAllItems,
2826
},
2927
];
3028

3129
return (
32-
<section className="button-group">
30+
<section className='button-group'>
3331
{secondaryButtons.map((button) => (
3432
<Button
3533
key={button.text + button.onClick.toString()}
36-
text={button.text}
3734
onClick={button.onClick}
38-
buttonType="secondary"
39-
/>
35+
buttonType='secondary'
36+
>
37+
{button.text}
38+
</Button>
4039
))}
4140
</section>
4241
);

0 commit comments

Comments
 (0)