Skip to content

Commit

Permalink
Include donation link in mobile web app
Browse files Browse the repository at this point in the history
  • Loading branch information
simonzheng committed Jan 6, 2024
1 parent 53690ec commit 12d4653
Showing 1 changed file with 81 additions and 76 deletions.
157 changes: 81 additions & 76 deletions components/AppLayout/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,88 +89,93 @@ const CustomLink = withStyles(theme => ({
</div>
));

function FactCheckSection({ classes }) {
return (
<div className={classes.column}>
<h3>{t`Fact Check`}</h3>
<CustomLink href="/articles">{t`Messages`}</CustomLink>
<CustomLink href="/replies">{c('App layout').t`Replies`}</CustomLink>
<CustomLink href="/hoax-for-you">{c('App layout').t`For You`}</CustomLink>
<CustomLink href="/tutorial">{c('App layout').t`Tutorial`}</CustomLink>
</div>
);
}

function AboutSection({ classes }) {
return (
<div className={classes.column}>
<h3>{t`About`}</h3>
<CustomLink href="/about">{t`About Cofacts`}</CustomLink>
<CustomLink href="/terms">{t`User Agreement`}</CustomLink>
<CustomLink external href={PROJECT_HACKFOLDR}>
{t`Introduction`}
</CustomLink>
<CustomLink external href={PROJECT_SOURCE_CODE}>
{t`Source Code`}
</CustomLink>
<CustomLink external href={PROJECT_MEDIUM}>
Medium
</CustomLink>
<CustomLink href="/impact">{t`Impact Report`}</CustomLink>
</div>
);
}

function ContactSection({ classes, isDesktop }) {
return (
<div className={classes.column}>
<h3>{t`Contact`}</h3>
<CustomLink
external
href={`mailto:${CONTACT_EMAIL}`}
icon={({ className }) => (
<img className={className} src={mailIcon} style={{ width: '30px' }} />
)}
>
{t`Contact Us`}
</CustomLink>
<CustomLink
external
href={EDITOR_FACEBOOK_GROUP}
icon={({ className }) => (
<img
className={className}
src={facebookIcon}
style={{ width: '30px' }}
/>
)}
>
{t`Facebook forum`}
</CustomLink>
<CustomLink
external
href={LINE_URL}
icon={({ className }) => (
<img className={className} src={lineIcon} style={{ width: '30px' }} />
)}
>
Line: @cofacts
</CustomLink>
{isDesktop && <GoogleWebsiteTranslator />}
<CustomLink external href={DONATION_URL}>
{t`Donate to Cofacts`}
</CustomLink>
</div>
);
}

function AppFooter() {
const classes = useStyles();
const matches = useMediaQuery('(min-width:768px)');
const isDesktop = useMediaQuery('(min-width:768px)');

return (
<Box component="footer" display={['none', 'none', 'block']}>
// <Box component="footer" display={['block', 'block', 'block']}>
<Box component="footer">
<div className={classes.first}>
<div className={classes.container}>
<div className={classes.column}>
<h3>{t`Fact Check`}</h3>
<CustomLink href="/articles">{t`Messages`}</CustomLink>
<CustomLink href="/replies">
{c('App layout').t`Replies`}
</CustomLink>
<CustomLink href="/hoax-for-you">
{c('App layout').t`For You`}
</CustomLink>
<CustomLink href="/tutorial">
{c('App layout').t`Tutorial`}
</CustomLink>
</div>
<div className={classes.column}>
<h3>{t`About`}</h3>
<CustomLink href="/about">{t`About Cofacts`}</CustomLink>
<CustomLink href="/terms">{t`User Agreement`}</CustomLink>
<CustomLink external href={PROJECT_HACKFOLDR}>
{t`Introduction`}
</CustomLink>
<CustomLink external href={PROJECT_SOURCE_CODE}>
{t`Source Code`}
</CustomLink>
<CustomLink external href={PROJECT_MEDIUM}>
Medium
</CustomLink>
<CustomLink href="/impact">{t`Impact Report`}</CustomLink>
</div>
<div className={classes.column}>
<h3>{t`Contact`}</h3>
<CustomLink
external
href={`mailto:${CONTACT_EMAIL}`}
icon={({ className }) => (
<img
className={className}
src={mailIcon}
style={{ width: '30px' }}
/>
)}
>
{t`Contact Us`}
</CustomLink>
<CustomLink
external
href={EDITOR_FACEBOOK_GROUP}
icon={({ className }) => (
<img
className={className}
src={facebookIcon}
style={{ width: '30px' }}
/>
)}
>
{t`Facebook forum`}
</CustomLink>
<CustomLink
external
href={LINE_URL}
icon={({ className }) => (
<img
className={className}
src={lineIcon}
style={{ width: '30px' }}
/>
)}
>
Line: @cofacts
</CustomLink>
{matches && <GoogleWebsiteTranslator />}
<CustomLink external href={DONATION_URL}>
{t`Donate to Cofacts`}
</CustomLink>
</div>
{isDesktop && <FactCheckSection classes={classes} />}
{isDesktop && <AboutSection classes={classes} />}
<ContactSection classes={classes} isDesktop={isDesktop} />
</div>
</div>
<div className={classes.second}>
Expand Down

0 comments on commit 12d4653

Please sign in to comment.