Skip to content

Commit

Permalink
Merge pull request #10 from SRN-SE-Fall24/filtertags
Browse files Browse the repository at this point in the history
Added tags as button to filter recipes
  • Loading branch information
nishadtardalkar authored Nov 1, 2024
2 parents dde0b9f + ba21fb3 commit 7a25f1c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Code/frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ const AppWithProvider = () => (
</AuthProvider>
);

export default AppWithProvider;
export default AppWithProvider;
26 changes: 26 additions & 0 deletions Code/frontend/src/components/TagFilter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// TagFilter.js
import React from "react";
import { Button, Box, Wrap, WrapItem } from "@chakra-ui/react";

const TagFilter = ({ tags, filterRecipesByTag }) => {
return (
<Box my={4}>
<Wrap spacing={2}>
{tags.map((tag, index) => (
<WrapItem key={index}>
<Button
colorScheme="green"
size="sm"
borderRadius="full"
onClick={() => filterRecipesByTag(tag)}
>
{tag}
</Button>
</WrapItem>
))}
</Wrap>
</Box>
);
};

export default TagFilter;

0 comments on commit 7a25f1c

Please sign in to comment.