-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
134 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
/* eslint-disable react/jsx-filename-extension */ | ||
/** | ||
* Implement Gatsby's Browser APIs in this file. | ||
* | ||
* See: https://www.gatsbyjs.org/docs/browser-apis/ | ||
*/ | ||
|
||
// You can delete this file if you're not using it | ||
import React from 'react'; | ||
import { WrapPageElementBrowserArgs, WrapRootElementBrowserArgs } from 'gatsby'; | ||
import { Provider } from 'react-redux'; | ||
|
||
import { store } from 'common/store'; | ||
import Layout from 'components/Layout'; | ||
|
||
export const wrapPageElement = ({ element, props }: WrapPageElementBrowserArgs) => { | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
return <Layout {...props}>{element}</Layout>; | ||
}; | ||
|
||
export const wrapRootElement = ({ element }: WrapRootElementBrowserArgs) => { | ||
return ( | ||
<Provider store={store}> | ||
{ element } | ||
</Provider> | ||
); | ||
}; |
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 |
---|---|---|
|
@@ -60,15 +60,15 @@ module.exports = { | |
icon: 'src/images/logo.png', // This path is relative to the root of the site. | ||
}, | ||
}, | ||
// { | ||
// resolve: 'gatsby-plugin-sentry', | ||
// options: { | ||
// dsn: 'https://[email protected]/5400964', | ||
// // Optional settings, see https://docs.sentry.io/clients/node/config/#optional-settings | ||
// environment: process.env.NODE_ENV, | ||
// enabled: (() => ['production', 'stage'].indexOf(process.env.NODE_ENV) !== -1)(), | ||
// }, | ||
// }, | ||
{ | ||
resolve: 'gatsby-plugin-sentry', | ||
options: { | ||
dsn: 'https://[email protected]/5400964', | ||
// Optional settings, see https://docs.sentry.io/clients/node/config/#optional-settings | ||
environment: process.env.NODE_ENV, | ||
enabled: (() => ['production', 'stage'].indexOf(process.env.NODE_ENV) !== -1)(), | ||
}, | ||
}, | ||
// this (optional) plugin enables Progressive Web App + Offline functionality | ||
// To learn more, visit: https://gatsby.dev/offline | ||
// TODO: Doesn't invalidate cache properly | ||
|
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
/* eslint-disable react/jsx-filename-extension */ | ||
/** | ||
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file. | ||
* | ||
* See: https://www.gatsbyjs.org/docs/ssr-apis/ | ||
*/ | ||
|
||
// You can delete this file if you're not using it | ||
import { WrapRootElementNodeArgs, WrapPageElementNodeArgs } from 'gatsby'; | ||
import React from 'react'; | ||
import { Provider } from 'react-redux'; | ||
|
||
import Layout from 'components/Layout'; | ||
import { store } from 'common/store'; | ||
|
||
export const wrapPageElement = ({ element, props }: WrapPageElementNodeArgs) => { | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
return <Layout {...props}>{element}</Layout>; | ||
}; | ||
|
||
export const wrapRootElement = ({ element }: WrapRootElementNodeArgs) => { | ||
return ( | ||
<Provider store={store}> | ||
{ element } | ||
</Provider> | ||
); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,23 @@ | ||
export enum StorageKey { | ||
FILTERS_STORAGE_KEY = 'dnd_filters', | ||
CHOSEN_SPELLS_STORAGE_KEY = 'dnd_chosen_spells' | ||
} | ||
|
||
export function loadState<T>(key: StorageKey) { | ||
try { | ||
const serializedState = localStorage.getItem(key); | ||
if (!serializedState) return undefined; | ||
return JSON.parse(serializedState) as T; | ||
} catch (e) { | ||
return undefined; | ||
} | ||
} | ||
|
||
export function saveState<T>(key: StorageKey, state: T) { | ||
try { | ||
const serializedState = JSON.stringify(state); | ||
localStorage.setItem(key, serializedState); | ||
} catch (e) { | ||
// Ignore | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import Layout from 'components/Layout'; | ||
|
||
const NotFoundPage: FC = () => ( | ||
<Layout> | ||
<> | ||
<h1>NOT FOUND</h1> | ||
<p>You just hit a route that doesn't exist... the sadness.</p> | ||
</Layout> | ||
</> | ||
); | ||
|
||
export default NotFoundPage; |
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