Skip to content

Commit

Permalink
Merge pull request #1947 from visualize-admin/fix/add-footer-to-profile
Browse files Browse the repository at this point in the history
feat: Added Footer to Profile Page
  • Loading branch information
noahonyejese authored Jan 8, 2025
2 parents e330c65 + 6af81d6 commit 31c183d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ You can also check the
- Fixed preview via API (iframe)
- Fixed cut table scroll-bars and unnecessary scroll of bar charts when
switching between chart types
- Added Footer to the Profile Page

# [5.0.2] - 2024-11-28

Expand Down
7 changes: 5 additions & 2 deletions app/login/components/profile-content-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import useEvent from "@/utils/use-event";

const useStyles = makeStyles<Theme>((theme) => ({
section: {
borderBottom: 1,
borderColor: "divider",
marginTop: theme.spacing(6),
},
tabList: {
Expand Down Expand Up @@ -49,6 +51,7 @@ export const ProfileContentTabs = (props: ProfileContentTabsProps) => {
const handleChange = useEvent((_: React.SyntheticEvent, v: string) => {
setValue(v);
});

const rootClasses = useRootStyles();
const classes = useStyles();

Expand All @@ -66,9 +69,9 @@ 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 className={classes.section}>
<TabList className={classes.tabList} onChange={handleChange}>
<Tab
className={classes.tab}
Expand Down
10 changes: 9 additions & 1 deletion app/login/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ 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%",
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 />
</Box>
</AppLayout>
);
Expand Down

0 comments on commit 31c183d

Please sign in to comment.