diff --git a/src/components/atoms/HostnameCheck.jsx b/src/components/atoms/HostnameCheck.jsx index 9fec9f8..93a6a8e 100644 --- a/src/components/atoms/HostnameCheck.jsx +++ b/src/components/atoms/HostnameCheck.jsx @@ -1,11 +1,8 @@ import React, { PureComponent } from 'react' +import Helmet from 'react-helmet' import styles from './HostnameCheck.module.scss' -const allowedHosts = [ - 'matthiaskretschmann.com', - 'beta.matthiaskretschmann.com', - 'localhost' -] +const allowedHosts = ['matthiaskretschmann.com', 'beta.matthiaskretschmann.com'] export default class HostnameInfo extends PureComponent { checkAllowedHost = () => { @@ -15,6 +12,7 @@ export default class HostnameInfo extends PureComponent { } state = { + // default to true so SSR builds never show the banner isAllowedHost: true } @@ -24,16 +22,19 @@ export default class HostnameInfo extends PureComponent { } render() { + // return nothing if we're on an allowed host if (this.state.isAllowedHost) return null return ( <> + + + ) diff --git a/src/components/atoms/HostnameCheck.module.scss b/src/components/atoms/HostnameCheck.module.scss index 699e68c..58b6f61 100644 --- a/src/components/atoms/HostnameCheck.module.scss +++ b/src/components/atoms/HostnameCheck.module.scss @@ -4,7 +4,7 @@ position: sticky; top: 0; z-index: 99; - padding: $spacer / 2 $spacer; + padding: $spacer / 3; font-size: $font-size-small; font-weight: bold; background: rgba($brand-light, .8); @@ -12,4 +12,11 @@ :global(.dark) & { background: rgba($body-background-color--dark, .8); } + + p { + margin: auto; + margin-bottom: 0; + max-width: $screen-lg; + text-align: center; + } }