-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #890 from CodeForAfrica/feat/engineeringblog_footer
@/engineeringblog Footer
- Loading branch information
Showing
13 changed files
with
212 additions
and
27 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 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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
"use client"; | ||
|
||
import { RichTypography, Section, StayInTouch } from "@commons-ui/core"; | ||
import { StyledLink as Link } from "@commons-ui/next"; | ||
import { Box, Grid } from "@mui/material"; | ||
import { styled } from "@mui/material/styles"; | ||
import type { SxProps, Theme } from "@mui/material/styles"; | ||
import React from "react"; | ||
|
||
import NavBarNavList from "@/engineeringblog/components/NavBarNavList"; | ||
import type { ConnectProps } from "@/engineeringblog/lib/data"; | ||
import type { Menu } from "@/engineeringblog/components/NavBarNavList"; | ||
|
||
interface FooterProps { | ||
copyright?: string; | ||
connect: ConnectProps; | ||
secondaryMenus?: Menu[]; | ||
sx?: SxProps<Theme>; | ||
} | ||
|
||
const FooterRoot = styled("footer")( | ||
({ theme: { breakpoints, palette, typography } }) => ({ | ||
backgroundColor: palette.background.default, | ||
borderTop: `1px solid ${palette.text.primary}`, | ||
color: palette.text.primary, | ||
mt: 2.5, | ||
[breakpoints.up("md")]: { | ||
mt: 5, | ||
}, | ||
}), | ||
); | ||
|
||
const Footer = React.forwardRef(function Footer( | ||
props: FooterProps, | ||
ref: React.Ref<HTMLDivElement>, | ||
) { | ||
const { copyright, connect, secondaryMenus, sx } = props; | ||
return ( | ||
<FooterRoot sx={sx} ref={ref}> | ||
<Section sx={{ px: { xs: 2.5, sm: 0 }, py: { xs: 2.5 } }}> | ||
<Grid container justifyContent="space-between"> | ||
<Grid | ||
item | ||
xs={12} | ||
container | ||
alignItems="center" | ||
justifyContent="space-between" | ||
> | ||
<Grid item xs={12} sm="auto" order={{ xs: 1, sm: 0 }}> | ||
<RichTypography | ||
textAlign={{ xs: "center", sm: "left" }} | ||
pt={{ xs: 1, sm: 0 }} | ||
> | ||
{copyright} | ||
</RichTypography> | ||
</Grid> | ||
<Grid | ||
item | ||
xs={12} | ||
sm="auto" | ||
order={{ xs: 0, sm: 1 }} | ||
container | ||
alignItems={{ xs: "flex-start", sm: "center" }} | ||
> | ||
<Grid item xs={12} sm="auto"> | ||
<Box component="nav"> | ||
<NavBarNavList | ||
NavListItemLinkProps={{ | ||
flexBasis: "auto", | ||
variant: "body1", | ||
sx: { | ||
mr: { xs: 0, sm: 1.5, md: 2.5 }, | ||
typography: { md: "body1" }, | ||
}, | ||
}} | ||
NavListItemProps={{ | ||
sx: { | ||
borderBottom: { xs: "none" }, | ||
py: { xs: 1, sm: 0 }, | ||
mr: { xs: 0, sm: 1.5, md: 2.5 }, | ||
"&:first-of-type": { | ||
pt: 0, | ||
}, | ||
}, | ||
}} | ||
direction="row" | ||
menus={secondaryMenus} | ||
sx={{ | ||
alignItems: { xs: "flex-start", sm: "center" }, | ||
display: "inline-flex", | ||
flexDirection: { xs: "column", sm: "row" }, | ||
justifyContent: "flex-start", | ||
}} | ||
/> | ||
</Box> | ||
</Grid> | ||
<Grid item> | ||
<StayInTouch | ||
{...connect} | ||
LinkProps={{ | ||
component: Link, | ||
sx: (theme: Theme) => ({ | ||
transition: theme.transitions.create(["opacity"]), | ||
}), | ||
}} | ||
TitleProps={{ variant: "footerCap" }} | ||
sx={{ | ||
mt: "0px", | ||
py: { xs: 1, sm: 0 }, | ||
}} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Section> | ||
</FooterRoot> | ||
); | ||
}); | ||
|
||
export type { FooterProps }; | ||
export default Footer; |
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,5 @@ | ||
import type { FooterProps } from "./Footer"; | ||
import Footer from "./Footer"; | ||
|
||
export type { FooterProps }; | ||
export default Footer; |
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 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 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
Oops, something went wrong.