-
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 #940 from CodeForAfrica/ft/climatemapped-footer
Ft/climatemapped Footer
- Loading branch information
Showing
43 changed files
with
1,678 additions
and
29 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
102 changes: 102 additions & 0 deletions
102
apps/climatemappedafrica/src/components/Footer/index.js
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,102 @@ | ||
import { QuickLinks, LogoButton, Copyright } from "@commons-ui/core"; | ||
import { Link, StayInTouch } from "@commons-ui/next"; | ||
import { RichText } from "@commons-ui/payload"; | ||
import { Grid } from "@mui/material"; | ||
import React from "react"; | ||
|
||
import useStyles from "./useStyles"; | ||
|
||
import Section from "@/climatemappedafrica/components/Section"; | ||
|
||
function Footer(props) { | ||
const { title, connect, description, logo: logoProps, links } = props; | ||
const classes = useStyles(props); | ||
return ( | ||
<div className={classes.root}> | ||
<Section | ||
classes={{ | ||
root: classes.section, | ||
}} | ||
> | ||
<Grid container direction="row" justifyContent="space-between"> | ||
<Grid item xs={12} container> | ||
{logoProps && ( | ||
<LogoButton | ||
{...logoProps} | ||
component="a" | ||
classes={{ | ||
root: classes.logoButton, | ||
}} | ||
/> | ||
)} | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
{description && ( | ||
<RichText | ||
variant="body1" | ||
className={classes.description} | ||
elements={description} | ||
typographyProps={{ | ||
LinkProps: { | ||
color: "text.secondary", | ||
sx: { | ||
textDecorationColor: "text.secondary", | ||
textDecoration: "underline", | ||
}, | ||
}, | ||
}} | ||
/> | ||
)} | ||
<Copyright | ||
copyright={`© ${new Date().getFullYear()} ${title}`} | ||
classes={{ | ||
root: classes.copyright, | ||
text: classes.copyrightText, | ||
}} | ||
/> | ||
</Grid> | ||
<Grid item xs={12} lg={4}> | ||
<Grid | ||
container | ||
classes={{ | ||
root: classes.allLinks, | ||
}} | ||
> | ||
<Grid item xs={12} lg={6}> | ||
{links && ( | ||
<QuickLinks | ||
linkComponent={Link} | ||
{...links} | ||
classes={{ | ||
root: classes.quickLinkRoot, | ||
list: classes.quickList, | ||
link: classes.quickLink, | ||
title: classes.quickLinksTitle, | ||
}} | ||
/> | ||
)} | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
<StayInTouch | ||
{...connect} | ||
LinkProps={{ | ||
component: Link, | ||
sx: { color: "text.secondary" }, | ||
}} | ||
TitleProps={{ | ||
variant: "footerCap", | ||
sx: { color: "text.secondary" }, | ||
}} | ||
sx={{ gap: 2 }} | ||
direction="column" | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Section> | ||
</div> | ||
); | ||
} | ||
|
||
export default Footer; |
160 changes: 160 additions & 0 deletions
160
apps/climatemappedafrica/src/components/Footer/index.stories.js
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,160 @@ | ||
/* eslint-disable import/no-anonymous-default-export */ | ||
import React from "react"; | ||
|
||
import Footer from "."; | ||
|
||
export default { | ||
title: "ClimateMappedAfrica/Sections/Footer", | ||
argTypes: { | ||
title: { | ||
control: { | ||
type: "text", | ||
}, | ||
}, | ||
socialMedia: { | ||
control: { | ||
type: "object", | ||
}, | ||
}, | ||
quickLinks: { | ||
control: { | ||
type: "array", | ||
}, | ||
}, | ||
description: { | ||
control: { | ||
type: "text", | ||
}, | ||
}, | ||
aboutVariant: { | ||
control: { | ||
type: "select", | ||
}, | ||
options: ["subtitle1", "body1"], | ||
}, | ||
copyrightProps: { | ||
control: { | ||
type: "object", | ||
}, | ||
}, | ||
logoProps: { | ||
control: { | ||
type: "object", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
function Template({ ...args }) { | ||
return <Footer {...args} />; | ||
} | ||
|
||
export const Default = Template.bind({}); | ||
|
||
Default.parameters = { | ||
nextjs: { | ||
router: { | ||
pathname: "/?path=/story/sections-footer--default", | ||
}, | ||
}, | ||
}; | ||
|
||
Default.args = { | ||
connect: { | ||
title: "Stay in Touch", | ||
links: [ | ||
{ | ||
platform: "Facebook", | ||
url: "https://www.google.com", | ||
id: "67050ad20d400b5e511b2871", | ||
}, | ||
{ | ||
platform: "Twitter", | ||
url: "https://Twitter.com", | ||
id: "6706844a6339b76017e6c782", | ||
}, | ||
], | ||
}, | ||
description: [ | ||
{ | ||
children: [ | ||
{ | ||
text: "This site is an ", | ||
children: null, | ||
}, | ||
{ | ||
newTab: false, | ||
type: "link", | ||
url: "https://github.com/CodeForAfrica/ui/tree/main/apps/roboshield", | ||
children: [ | ||
{ | ||
text: "open source code", | ||
children: null, | ||
}, | ||
], | ||
href: "https://github.com/CodeForAfrica/ui/tree/main/apps/roboshield", | ||
}, | ||
{ | ||
text: " built by ", | ||
children: null, | ||
}, | ||
{ | ||
newTab: false, | ||
type: "link", | ||
url: "https://codeforafrica.org/", | ||
children: [ | ||
{ | ||
text: "Code for Africa", | ||
children: null, | ||
}, | ||
], | ||
href: "https://codeforafrica.org/", | ||
}, | ||
{ | ||
text: ", the continent's largest network of civic technology and data journalism labs. All content is released under a ", | ||
children: null, | ||
}, | ||
{ | ||
newTab: false, | ||
type: "link", | ||
url: "https://creativecommons.org/licenses/by/4.0/", | ||
children: [ | ||
{ | ||
text: "Creative Commons 4 Attribution", | ||
children: null, | ||
}, | ||
], | ||
href: "https://creativecommons.org/licenses/by/4.0/", | ||
}, | ||
{ | ||
text: " License. Reuse it to help empower your own community.", | ||
children: null, | ||
}, | ||
], | ||
}, | ||
], | ||
links: { | ||
title: "Resources", | ||
links: [ | ||
{ | ||
label: "About", | ||
linkType: "custom", | ||
url: "/", | ||
href: "/", | ||
id: "67063751048cfcc79c43a6f9", | ||
}, | ||
{ | ||
label: "Privacy Policy", | ||
linkType: "custom", | ||
url: "/", | ||
href: "/", | ||
id: "6706375d048cfcc79c43a6fa", | ||
}, | ||
], | ||
}, | ||
logo: { | ||
alt: "ClimateMappedAfrica", | ||
src: "http://localhost:3000/media/Group-4426.svg", | ||
}, | ||
title: "Climate Mapped Africa", | ||
}; |
Oops, something went wrong.