-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(settings): implement settings page component with links
Signed-off-by: kshitij79 <[email protected]>
- Loading branch information
Showing
3 changed files
with
96 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,104 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import { Typography, Box } from "@mui/material"; | ||
import { | ||
Box, | ||
Typography, | ||
List, | ||
ListItem, | ||
ListItemButton, | ||
ListItemIcon, | ||
ListItemText, | ||
Divider, | ||
} from "@mui/material"; | ||
import AccountCircleIcon from "@mui/icons-material/Person"; | ||
import NotificationsIcon from "@mui/icons-material/NotificationsNoneOutlined"; | ||
import PrivacyTipIcon from "@mui/icons-material/PrivacyTipOutlined"; | ||
import GavelIcon from "@mui/icons-material/ClassOutlined"; | ||
import SupportIcon from "@mui/icons-material/ContactSupportOutlined"; | ||
import InfoIcon from "@mui/icons-material/InfoOutlined"; | ||
import FeedbackIcon from "@mui/icons-material/CommentOutlined"; | ||
import ChevronRightIcon from "@mui/icons-material/ChevronRight"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
export default function Settings() { | ||
const router = useRouter(); | ||
|
||
const settingsItems = [ | ||
{ | ||
icon: <AccountCircleIcon />, | ||
text: "Account", | ||
route: "/settings/account", | ||
}, | ||
{ | ||
icon: <NotificationsIcon />, | ||
text: "Notifications", | ||
route: "/settings/notifications", | ||
}, | ||
{ | ||
icon: <PrivacyTipIcon />, | ||
text: "Data and Privacy", | ||
route: "/settings/data-privacy", | ||
}, | ||
{ icon: <GavelIcon />, text: "Legal", route: "/settings/legal" }, | ||
{ icon: <SupportIcon />, text: "Support", route: "/settings/support" }, | ||
{ icon: <InfoIcon />, text: "About", route: "/settings/about" }, | ||
{ | ||
icon: <FeedbackIcon />, | ||
text: "Send Feedback", | ||
secondaryText: "Version 1.0", | ||
route: "/settings/feedback", | ||
}, | ||
]; | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
height: "100vh", | ||
padding: "16px", | ||
maxWidth: "600px", | ||
margin: "0 auto", | ||
}}> | ||
<Typography variant="h4">Settings Page</Typography> | ||
<Typography variant="h4" gutterBottom> | ||
Settings | ||
</Typography> | ||
<List> | ||
{settingsItems.map(item => ( | ||
<React.Fragment key={item.route}> | ||
<ListItem disablePadding sx={{ backgroundColor: "white" }}> | ||
<ListItemButton onClick={() => router.push(item.route)}> | ||
<ListItemIcon>{item.icon}</ListItemIcon> | ||
<ListItemText | ||
primary={item.text} | ||
secondary={item.secondaryText || null} | ||
primaryTypographyProps={{ | ||
sx: { | ||
fontWeight: item.secondaryText ? "normal" : "normal", | ||
}, | ||
}} | ||
secondaryTypographyProps={{ | ||
sx: { fontSize: "0.8em", color: "gray" }, | ||
}} | ||
/> | ||
<ChevronRightIcon /> | ||
</ListItemButton> | ||
</ListItem> | ||
<Divider /> | ||
</React.Fragment> | ||
))} | ||
</List> | ||
|
||
<List> | ||
<ListItem disablePadding> | ||
<ListItemButton onClick={() => router.push("/logout")}> | ||
<ListItemText | ||
primary="LOG OUT" | ||
primaryTypographyProps={{ | ||
sx: { fontWeight: "bold", textAlign: "center" }, | ||
}} | ||
/> | ||
</ListItemButton> | ||
</ListItem> | ||
</List> | ||
</Box> | ||
); | ||
} |
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