Skip to content

Commit

Permalink
Merge pull request #567 from cofacts/mgp
Browse files Browse the repository at this point in the history
feat: apply notification and footer banner to website pages
  • Loading branch information
MrOrz authored Apr 8, 2024
2 parents 4045f20 + 33b001f commit 734ee25
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
22 changes: 20 additions & 2 deletions components/AppLayout/AppLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ const USER_QUERY = gql`
${AppHeader.fragments.AppHeaderUserData}
`;

const useStyles = makeStyles({
const useStyles = makeStyles(theme => ({
container: {
flex: 1,
},
});
mgp: {
color: '#fff',
background: theme.palette.secondary[500],
display: 'flex',
gap: 8,
padding: 8,
justifyContent: 'center',
'& > a': {
color: theme.palette.primary[500],
},
},
}));

const apiLogout = () => {
return fetchAPI('/logout').then(resp => resp.json());
Expand Down Expand Up @@ -86,6 +97,13 @@ function AppLayout({ children, container = true }) {

return (
<Fragment>
<div className={classes.mgp}>
🏆 謠言惑眾獎 🏆 投票到 4/12 唷!
<a href="https://www.mygopen.com/p/award_22.html?utm_source=cofacts&utm_medium=site-notif">
活動詳情
</a>
<a href="https://cofacts.tw/mgp">用 LINE 投票去</a>
</div>
<AppHeader
user={data?.GetUser}
showProgress={isRouteChanging}
Expand Down
15 changes: 9 additions & 6 deletions pages/article/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ import CooccurrenceSection, {
fragments as CooccurrenceSectionFragments,
} from 'components/CooccurrenceSection';

const MGP_URL =
'https://www.mygopen.com/p/award_22.html??utm_source=cofacts&utm_medium=footer';

const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
Expand Down Expand Up @@ -562,11 +565,11 @@ function ArticlePage() {
)}

<Hidden smDown implementation="css">
<a href={LINE_URL}>
<a href={MGP_URL}>
<img
className={classes.bannerImage}
src="/[email protected]"
alt={t`Add Cofacts as friend in LINE`}
src="/mgp.jpg"
alt="第四屆謠言惑眾獎投票中!"
/>
</a>
</Hidden>
Expand Down Expand Up @@ -620,11 +623,11 @@ function ArticlePage() {
</Box>
</div>
<Hidden mdUp implementation="css">
<a href={LINE_URL}>
<a href={MGP_URL}>
<img
className={classes.bannerImage}
src="/[email protected]"
alt={t`Add Cofacts as friend in LINE`}
src="/mgp.jpg"
alt="第四屆謠言惑眾獎投票中!"
style={{ marginBottom: 24 }}
/>
</a>
Expand Down
Binary file added public/mgp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 734ee25

Please sign in to comment.