Skip to content

Commit

Permalink
feat: apply notification and footer banner to website pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Apr 8, 2024
1 parent 4045f20 commit 33b001f
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="/line-banner-desktop@2x.png"
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="/line-banner-mobile@2x.png"
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 33b001f

Please sign in to comment.