Skip to content

Commit

Permalink
Merge pull request #346 from cofacts/banner
Browse files Browse the repository at this point in the history
Add favicon and article detail banner
  • Loading branch information
MrOrz authored Oct 8, 2020
2 parents 5173cbb + 0af94f0 commit 15f8923
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class MyDocument extends Document {
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>

<link rel="icon" href="/favicon.png" type="image/png" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />

{/* PWA primary color */}
<meta name="theme-color" content={lightTheme.palette.primary.main} />
<link
Expand Down
26 changes: 25 additions & 1 deletion pages/article/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import gql from 'graphql-tag';
import Link from 'next/link';
import { useEffect, useRef, useCallback, useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Box, Snackbar } from '@material-ui/core';
import { Box, Hidden, Snackbar } from '@material-ui/core';
import { ngettext, msgid, t } from 'ttag';

import { useRouter } from 'next/router';
Expand Down Expand Up @@ -174,6 +174,10 @@ const useStyles = makeStyles(theme => ({
lineHeight: '20px',
margin: '0 12px',
},
bannerImage: {
width: '100%',
borderRadius: theme.shape.borderRadius,
},
}));

const LOAD_ARTICLE = gql`
Expand Down Expand Up @@ -460,6 +464,16 @@ function ArticlePage() {
</CardHeader>
<CurrentReplies articleReplies={article.articleReplies} />
</Card>

<Hidden smDown implementation="css">
<a href={LINE_URL}>
<img
className={classes.bannerImage}
src="/[email protected]"
alt={t`Add Cofacts as friend in LINE`}
/>
</a>
</Hidden>
</div>

<aside className={classes.aside}>
Expand All @@ -484,6 +498,16 @@ function ArticlePage() {
)}
</aside>
</div>
<Hidden mdUp implementation="css">
<a href={LINE_URL}>
<img
className={classes.bannerImage}
src="/[email protected]"
alt={t`Add Cofacts as friend in LINE`}
style={{ marginBottom: 24 }}
/>
</a>
</Hidden>
<Snackbar
open={!!flashMessage}
onClose={() => setFlashMessage('')}
Expand Down
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/[email protected]
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 15f8923

Please sign in to comment.