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

feat: apply notification and footer banner to website pages #567

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
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
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.
Loading