mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 09:13:35 +01:00
fix SSR build
This commit is contained in:
parent
e5adbb68c5
commit
e651786b01
@ -215,7 +215,7 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
resolve: 'gatsby-plugin-sitemap',
|
resolve: 'gatsby-plugin-sitemap',
|
||||||
options: {
|
options: {
|
||||||
exclude: ['/page/*', '/tags/**/*']
|
exclude: ['/page/*', '/tags/**/*', '/thanks/*']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@ import shortid from 'shortid'
|
|||||||
import Helmet from 'react-helmet'
|
import Helmet from 'react-helmet'
|
||||||
import { Author } from '../@types/Site'
|
import { Author } from '../@types/Site'
|
||||||
import { useSiteMetadata } from '../hooks/use-site-metadata'
|
import { useSiteMetadata } from '../hooks/use-site-metadata'
|
||||||
import Typekit from '../components/atoms/Typekit'
|
|
||||||
import Qr from '../components/atoms/Qr'
|
import Qr from '../components/atoms/Qr'
|
||||||
import Icon from '../components/atoms/Icon'
|
import Icon from '../components/atoms/Icon'
|
||||||
import styles from './thanks.module.scss'
|
import styles from './thanks.module.scss'
|
||||||
@ -30,6 +29,7 @@ export default function Thanks() {
|
|||||||
const coins = Object.keys(author).filter(
|
const coins = Object.keys(author).filter(
|
||||||
key => key === 'bitcoin' || key === 'ether'
|
key => key === 'bitcoin' || key === 'ether'
|
||||||
)
|
)
|
||||||
|
const isSSR = typeof window === 'undefined'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -40,29 +40,29 @@ export default function Thanks() {
|
|||||||
|
|
||||||
<article className={styles.thanks}>
|
<article className={styles.thanks}>
|
||||||
<BackButton />
|
<BackButton />
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1 className={styles.title}>Say Thanks</h1>
|
<h1 className={styles.title}>Say Thanks</h1>
|
||||||
</header>
|
</header>
|
||||||
|
{!isSSR && (
|
||||||
|
<Suspense fallback={<div className={styles.loading}>Loading...</div>}>
|
||||||
|
<Web3Donation address={author.ether} />
|
||||||
|
|
||||||
<Suspense fallback={<div className={styles.loading}>Loading...</div>}>
|
<div className={styles.coins}>
|
||||||
<Web3Donation address={author.ether} />
|
<header>
|
||||||
|
<h4>Any other wallets</h4>
|
||||||
|
<p>Send Bitcoin or Ether from any wallet.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
<div className={styles.coins}>
|
{coins.map((address: string) => (
|
||||||
<header>
|
<Coin
|
||||||
<h4>Any other wallets</h4>
|
key={shortid.generate()}
|
||||||
<p>Send Bitcoin or Ether from any wallet.</p>
|
address={address}
|
||||||
</header>
|
author={author}
|
||||||
|
/>
|
||||||
{coins.map((address: string) => (
|
))}
|
||||||
<Coin
|
</div>
|
||||||
key={shortid.generate()}
|
</Suspense>
|
||||||
address={address}
|
)}
|
||||||
author={author}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</Suspense>
|
|
||||||
</article>
|
</article>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react'
|
import React from 'react'
|
||||||
import { useSiteMetadata } from '../../hooks/use-site-metadata'
|
import { useSiteMetadata } from '../../hooks/use-site-metadata'
|
||||||
import styles from './PostActions.module.scss'
|
import styles from './PostActions.module.scss'
|
||||||
import Icon from '../../components/atoms/Icon'
|
import Icon from '../../components/atoms/Icon'
|
||||||
|
Loading…
Reference in New Issue
Block a user