-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e37f102
commit 4d14802
Showing
6 changed files
with
118 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Image, { StaticImageData } from "next/image"; | ||
import React from "react"; | ||
import { CardActionArea, Typography, CardHeader } from '@mui/material'; | ||
import { useRouter } from "next/navigation"; | ||
import CardContent from '@mui/material/CardContent'; | ||
|
||
// TODO: CHANGE types to match final DB | ||
type CategoryCardProps = { | ||
title: string; | ||
image: StaticImageData; | ||
}; | ||
|
||
const CustomCardContent: React.FC<CategoryCardProps> =({title, image})=>{ | ||
const router = useRouter(); | ||
const navigate=()=>{ | ||
const encodedCategoryId = encodeURIComponent(title); //sanitize item name for route | ||
router.push(`/category-page/${encodedCategoryId}`); | ||
} | ||
return ( | ||
<CardActionArea onClick={() => navigate()}> | ||
<CardContent> | ||
<Image src={image} alt="logo" style={{width: "100%"}} /> | ||
<Typography variant='h5' align='center' gutterBottom> | ||
{title} | ||
</Typography> | ||
</CardContent> | ||
</CardActionArea> | ||
) | ||
} | ||
|
||
export default CustomCardContent; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters