-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into undocumented/env-vars-docs
- Loading branch information
Showing
9 changed files
with
183 additions
and
40 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
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,120 @@ | ||
import { FC, useMemo } from 'react'; | ||
import { Box, List, ListItem, Typography } from '@mui/material'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
|
||
import messageIds from 'zui/l10n/messageIds'; | ||
import { Msg, useMessages } from 'core/i18n'; | ||
import theme from 'theme'; | ||
import { useEnv } from 'core/hooks'; | ||
|
||
const ZUIPublicFooter: FC = () => { | ||
const env = useEnv(); | ||
const messages = useMessages(messageIds); | ||
|
||
const links = useMemo( | ||
() => [ | ||
{ | ||
href: 'https://zetkin.org/', | ||
text: messages.publicFooter.links.foundation(), | ||
}, | ||
{ | ||
href: | ||
typeof env.vars.ZETKIN_PRIVACY_POLICY_LINK === 'string' | ||
? env.vars.ZETKIN_PRIVACY_POLICY_LINK | ||
: messages.publicFooter.privacyPolicyLink(), | ||
text: messages.publicFooter.links.privacy(), | ||
}, | ||
...(typeof env.vars.INSTANCE_OWNER_NAME === 'string' && | ||
typeof env.vars.INSTANCE_OWNER_HREF === 'string' | ||
? [ | ||
{ | ||
href: env.vars.INSTANCE_OWNER_HREF as string, | ||
text: env.vars.INSTANCE_OWNER_NAME as string, | ||
}, | ||
] | ||
: []), | ||
], | ||
[messages] | ||
); | ||
|
||
return ( | ||
<Box component="footer" px={2} py={8}> | ||
<Box alignItems="center" display="flex" flexDirection="column"> | ||
<Box flex={1} maxWidth="sm" width="100%"> | ||
<Box pb={4}> | ||
<Typography | ||
color={theme.palette.secondary.light} | ||
component="p" | ||
fontSize="1rem" | ||
textAlign="center" | ||
> | ||
<Msg id={messageIds.publicFooter.text} /> | ||
</Typography> | ||
</Box> | ||
{typeof env.vars.INSTANCE_OWNER_NAME === 'string' && ( | ||
<Box pb={4}> | ||
<Typography | ||
color={theme.palette.secondary.light} | ||
component="p" | ||
fontSize="1rem" | ||
textAlign="center" | ||
> | ||
<Msg | ||
id={messageIds.publicFooter.hostingOrganization} | ||
values={{ | ||
name: env.vars.INSTANCE_OWNER_NAME, | ||
}} | ||
/> | ||
</Typography> | ||
</Box> | ||
)} | ||
<Box display="flex" justifyContent="center" py={4}> | ||
<Image | ||
alt="" | ||
className="Footer-logo" | ||
height={64} | ||
src="/logo-zetkin.png" | ||
width={64} | ||
/> | ||
</Box> | ||
<List | ||
sx={{ | ||
columnGap: theme.spacing(1), | ||
display: 'flex', | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
{links.map((link) => ( | ||
<ListItem | ||
key={link.href} | ||
sx={{ | ||
'&:not(:last-child)': { | ||
borderRightColor: theme.palette.divider, | ||
borderRightStyle: 'solid', | ||
borderRightWidth: 1, | ||
paddingRight: theme.spacing(1), | ||
}, | ||
padding: 0, | ||
width: 'inherit', | ||
}} | ||
> | ||
<Link | ||
href={link.href} | ||
style={{ color: theme.palette.secondary.light }} | ||
target="_blank" | ||
> | ||
{link.text} | ||
</Link> | ||
</ListItem> | ||
))} | ||
</List> | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ZUIPublicFooter; |
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
Hey @henrycatalinismith
while i was looking for the reason, my local devserver is not working anymore, I found out you made a typo here 🙈