Skip to content

Commit

Permalink
Add organization name and link to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
henrycatalinismith committed Dec 27, 2024
1 parent 213b7b3 commit 656ac94
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/features/surveys/components/surveyForm/SurveyFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@ const SurveyFooter: FC = () => {
() => [
{
href: 'https://zetkin.org/',
text: messageIds.surveyFooter.links.foundation,
text: messages.surveyFooter.links.foundation(),
},
{
href:
process.env.ZETKIN_PRIVACY_POLICY_LINK ||
messages.surveyForm.policy.link(),
text: messageIds.surveyFooter.links.privacy,
text: messages.surveyFooter.links.privacy(),
},
...(typeof process.env.NEXT_PUBLIC_HOSTING_ORGANIZATION_NAME ===
'string' &&
typeof process.env.NEXT_PUBLIC_HOSTING_ORGANIZATION_HREF === 'string'
? [
{
href: process.env.NEXT_PUBLIC_HOSTING_ORGANIZATION_HREF,
text: process.env.NEXT_PUBLIC_HOSTING_ORGANIZATION_NAME,
},
]
: []),
],
[messages]
);
Expand All @@ -40,6 +50,24 @@ const SurveyFooter: FC = () => {
<Msg id={messageIds.surveyFooter.text} />
</Typography>
</Box>
{typeof process.env.NEXT_PUBLIC_HOSTING_ORGANIZATION_NAME ===
'string' && (
<Box pb={4}>
<Typography
color={theme.palette.secondary.light}
component="p"
fontSize="1rem"
textAlign="center"
>
<Msg
id={messageIds.surveyFooter.hostingOrganization}
values={{
name: process.env.NEXT_PUBLIC_HOSTING_ORGANIZATION_NAME,
}}
/>
</Typography>
</Box>
)}
<Box display="flex" justifyContent="center" py={4}>
<Image
alt=""
Expand Down Expand Up @@ -77,7 +105,7 @@ const SurveyFooter: FC = () => {
style={{ color: theme.palette.secondary.light }}
target="_blank"
>
<Msg id={link.text} />
{link.text}
</Link>
</ListItem>
))}
Expand Down
3 changes: 3 additions & 0 deletions src/features/surveys/l10n/messageIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ export default makeMessages('feat.surveys', {
title: m('Add email address'),
},
surveyFooter: {
hostingOrganization: m<{ name: string }>(
'This instance of Zetkin is hosted and managed by {name}.'
),
links: {
foundation: m('Zetkin Foundation'),
privacy: m('Privacy Policy'),
Expand Down

0 comments on commit 656ac94

Please sign in to comment.