-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #389 from gregrickaby/feature/3.0.1
v3.0.1
- Loading branch information
Showing
17 changed files
with
356 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {createStyles} from '@mantine/core' | ||
import {IconBrandGithub} from '@tabler/icons' | ||
import config from '~/lib/config' | ||
|
||
const useStyles = createStyles((theme) => ({ | ||
footer: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
gap: theme.spacing.md, | ||
justifyContent: 'center', | ||
textAlign: 'center', | ||
|
||
a: { | ||
color: theme.colors.dark[0] | ||
} | ||
} | ||
})) | ||
|
||
/** | ||
* Footer component. | ||
*/ | ||
export default function Footer() { | ||
const {classes} = useStyles() | ||
return ( | ||
<footer className={classes.footer}> | ||
<p> | ||
website by{' '} | ||
<a href={config.authorUrl} target="_blank" rel="noopener noreferrer"> | ||
{config.siteAuthor} | ||
</a> | ||
</p> | ||
<p> | ||
<a | ||
href="https://github.com/gregrickaby/reddit-image-viewer" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<IconBrandGithub /> | ||
</a> | ||
</p> | ||
</footer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {createStyles} from '@mantine/core' | ||
import config from '~/lib/config' | ||
|
||
const useStyles = createStyles((theme) => ({ | ||
header: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
[`@media (max-width: ${theme.breakpoints.sm}px)`]: { | ||
flexDirection: 'column', | ||
textAlign: 'center' | ||
} | ||
}, | ||
title: { | ||
fontSize: theme.fontSizes.xl, | ||
margin: 0, | ||
[`@media (max-width: ${theme.breakpoints.sm}px)`]: { | ||
lineHeight: 1 | ||
} | ||
} | ||
})) | ||
|
||
export default function Header() { | ||
const {classes} = useStyles() | ||
return ( | ||
<header className={classes.header}> | ||
<h1 className={classes.title}>{config.siteTitle}</h1> | ||
<p>{config.siteDescription}</p> | ||
</header> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import Head from 'next/head' | ||
import config from '~/lib/config' | ||
|
||
export default function Meta() { | ||
return ( | ||
<Head> | ||
<title>{config?.siteTitle}</title> | ||
<meta name="description" content={config?.siteDescription} /> | ||
|
||
<meta httpEquiv="x-ua-compatible" content="ie=edge" /> | ||
<link rel="preconnect" href="//preview.redd.it" crossOrigin="anonymous" /> | ||
<link rel="preconnect" href="//v.redd.it" crossOrigin="anonymous" /> | ||
<link | ||
rel="preconnect" | ||
href="//external-preview.redd.it" | ||
crossOrigin="anonymous" | ||
/> | ||
<link rel="preconnect" href="//i.imgur.com" crossOrigin="anonymous" /> | ||
<link | ||
as="fetch" | ||
rel="preload" | ||
href="/api/reddit?sub=itookapicture&sort=hot&limit=24&after=" | ||
crossOrigin="same-origin" | ||
/> | ||
<link rel="shortcut icon" href="/favicon/favicon.ico" /> | ||
<link rel="apple-touch-icon" href="/favicon/icon.png" /> | ||
<link rel="icon" href="/favicon/icon.png" sizes="192x192" /> | ||
|
||
<meta property="og:type" content="website" /> | ||
<meta property="og:url" content={config?.siteUrl} /> | ||
<meta property="og:title" content={config?.siteTitle} /> | ||
<meta property="og:description" content={config?.siteDescription} /> | ||
<meta | ||
property="og:image" | ||
content={`${config?.siteUrl}social-share.jpg`} | ||
/> | ||
|
||
<meta property="twitter:card" content="summary_large_image" /> | ||
<meta property="twitter:url" content={config?.siteUrl} /> | ||
<meta property="twitter:title" content={config?.siteTitle} /> | ||
<meta property="twitter:description" content={config?.siteDescription} /> | ||
<meta | ||
property="twitter:image" | ||
content={`${config?.siteUrl}social-share.jpg`} | ||
/> | ||
|
||
<meta | ||
name="google-site-verification" | ||
content={process.env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION} | ||
/> | ||
</Head> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
Button, | ||
createStyles, | ||
Group, | ||
Modal, | ||
Switch, | ||
useMantineColorScheme | ||
} from '@mantine/core' | ||
import {IconSettings} from '@tabler/icons' | ||
import {useState} from 'react' | ||
|
||
const useStyles = createStyles(() => ({ | ||
settings: {} | ||
})) | ||
|
||
export default function Settings() { | ||
const {classes} = useStyles() | ||
const [opened, setOpened] = useState(false) | ||
const {colorScheme, toggleColorScheme} = useMantineColorScheme() | ||
|
||
return ( | ||
<> | ||
<Modal onClose={() => setOpened(false)} opened={opened} title="Settings"> | ||
<Switch | ||
aria-label="Toggle between light and dark theme." | ||
label="Toggle Dark Theme (⌘+J)" | ||
checked={colorScheme === 'dark'} | ||
offLabel="OFF" | ||
onChange={() => toggleColorScheme()} | ||
onLabel="ON" | ||
size="lg" | ||
/> | ||
</Modal> | ||
|
||
<Group className={classes.settings}> | ||
<Button | ||
aria-label="open settings" | ||
color="gray" | ||
onClick={() => setOpened(true)} | ||
variant="subtle" | ||
> | ||
<IconSettings /> | ||
</Button> | ||
</Group> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c6a1ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
reddit-image-viewer – ./
reddit-image-viewer.vercel.app
reddit-image-viewer-git-main-gregrickaby.vercel.app
reddit-image-viewer-gregrickaby.vercel.app