Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added Footer to Profile Page #1947

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions app/login/components/profile-content-tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { t } from "@lingui/macro";
import { TabContext, TabList, TabPanel } from "@mui/lab";
import { Box, Tab, Theme } from "@mui/material";
import { Box, Tab, Theme, useTheme } from "@mui/material";
import { makeStyles } from "@mui/styles";
import clsx from "clsx";
import groupBy from "lodash/groupBy";
Expand All @@ -12,9 +12,6 @@ import { useRootStyles } from "@/login/utils";
import useEvent from "@/utils/use-event";

const useStyles = makeStyles<Theme>((theme) => ({
section: {
marginTop: theme.spacing(6),
},
tabList: {
minHeight: "fit-content",

Expand Down Expand Up @@ -49,6 +46,7 @@ export const ProfileContentTabs = (props: ProfileContentTabsProps) => {
const handleChange = useEvent((_: React.SyntheticEvent, v: string) => {
setValue(v);
});
const theme = useTheme();
const rootClasses = useRootStyles();
const classes = useStyles();

Expand All @@ -66,9 +64,15 @@ export const ProfileContentTabs = (props: ProfileContentTabsProps) => {

return (
<TabContext value={value}>
<Box className={clsx(rootClasses.section, classes.section)}>
<Box className={clsx(rootClasses.section)}>
<Box className={rootClasses.sectionContent}>
<Box sx={{ borderBottom: 1, borderColor: "divider" }}>
<Box
sx={{
borderBottom: 1,
borderColor: "divider",
marginTop: theme.spacing(6),
}}
>
noahonyejese marked this conversation as resolved.
Show resolved Hide resolved
<TabList className={classes.tabList} onChange={handleChange}>
<Tab
className={classes.tab}
Expand Down
11 changes: 9 additions & 2 deletions app/login/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,27 @@ import { HEADER_HEIGHT } from "@/components/header-constants";
export const useRootStyles = makeStyles<Theme>((theme) => ({
root: {
marginTop: `${HEADER_HEIGHT}px`,
backgroundColor: theme.palette.muted.main,
minHeight: `calc(100vh - ${HEADER_HEIGHT}px)`,
display: "flex",
flexDirection: "column",
},
content: {
flexGrow: 1,
display: "flex",
flexDirection: "column",
},
section: {
display: "flex",
flexDirection: "column",
padding: `0 ${theme.spacing(6)}`,
backgroundColor: theme.palette.muted.main,
},
sectionContent: {
width: "100%",
maxWidth: 1400,
margin: "0 auto",
},
noTooltip: {
// Disable native tooltip in Safari
"&::after": {
noahonyejese marked this conversation as resolved.
Show resolved Hide resolved
content: "''",
display: "block",
Expand Down
6 changes: 5 additions & 1 deletion app/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { User } from "@prisma/client";
import { GetServerSideProps } from "next";
import { getServerSession } from "next-auth";

import { Footer } from "@/components/footer";
import { AppLayout } from "@/components/layout";
import { getUserConfigs, ParsedConfig } from "@/db/config";
import { deserializeProps, Serialized, serializeProps } from "@/db/serialize";
Expand Down Expand Up @@ -57,7 +58,10 @@ const ProfilePage = (props: Serialized<PageProps>) => {
<AppLayout>
<Box className={rootClasses.root}>
<ProfileHeader user={user} />
<ProfileContentTabs userId={user.id} />
<Box sx={{ flexGrow: 1, display: "flex", flexDirection: "column" }}>
<ProfileContentTabs userId={user.id} />
</Box>
<Footer />
noahonyejese marked this conversation as resolved.
Show resolved Hide resolved
</Box>
</AppLayout>
);
Expand Down
Loading