Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include donation link in mobile web app (simonzheng/20240106) #557

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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