Hiding content that requires JS when JS is disabled
This commit is contained in:
parent
c7ea0659f4
commit
f0233ee030
@ -3,6 +3,7 @@
|
|||||||
exports[`Form rendering 1`] = `
|
exports[`Form rendering 1`] = `
|
||||||
<div
|
<div
|
||||||
className="form"
|
className="form"
|
||||||
|
data-requires-js={true}
|
||||||
>
|
>
|
||||||
<form
|
<form
|
||||||
onSubmit={[Function]}
|
onSubmit={[Function]}
|
||||||
|
@ -53,7 +53,7 @@ class Form extends React.PureComponent {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const { expr, syntax } = this.state;
|
const { expr, syntax } = this.state;
|
||||||
|
|
||||||
return <div className={ style.form }>
|
return <div className={ style.form } data-requires-js>
|
||||||
<form onSubmit={ this.handleSubmit }>
|
<form onSubmit={ this.handleSubmit }>
|
||||||
<textarea
|
<textarea
|
||||||
name="expr"
|
name="expr"
|
||||||
|
@ -39,7 +39,9 @@ exports[`Header rendering 1`] = `
|
|||||||
</WithMergedOptions(TransComponent)>
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li
|
||||||
|
data-requires-js={true}
|
||||||
|
>
|
||||||
<LoadNamespace(LocaleSwitcher) />
|
<LoadNamespace(LocaleSwitcher) />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -85,7 +87,9 @@ exports[`Header rendering with no banner 1`] = `
|
|||||||
</WithMergedOptions(TransComponent)>
|
</WithMergedOptions(TransComponent)>
|
||||||
</mockConstructor>
|
</mockConstructor>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li
|
||||||
|
data-requires-js={true}
|
||||||
|
>
|
||||||
<LoadNamespace(LocaleSwitcher) />
|
<LoadNamespace(LocaleSwitcher) />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -31,7 +31,7 @@ export const Header = ({ banner }) => (
|
|||||||
<Trans>Privacy Policy</Trans>
|
<Trans>Privacy Policy</Trans>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li data-requires-js>
|
||||||
<LocaleSwitcher />
|
<LocaleSwitcher />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
exports[`Layout rendering 1`] = `
|
exports[`Layout rendering 1`] = `
|
||||||
<SentryBoundary>
|
<SentryBoundary>
|
||||||
|
<noscript>
|
||||||
|
<style
|
||||||
|
type="text/css"
|
||||||
|
>
|
||||||
|
|
||||||
|
[data-requires-js] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</noscript>
|
||||||
<LoadNamespace(Header)
|
<LoadNamespace(Header)
|
||||||
banner="Test Banner"
|
banner="Test Banner"
|
||||||
/>
|
/>
|
||||||
|
@ -17,7 +17,16 @@ const query = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const noscriptStyle = `
|
||||||
|
[data-requires-js] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
export const Layout = ({ banner, buildId, children }) => <SentryBoundary>
|
export const Layout = ({ banner, buildId, children }) => <SentryBoundary>
|
||||||
|
<noscript>
|
||||||
|
<style type="text/css">{ noscriptStyle }</style>
|
||||||
|
</noscript>
|
||||||
<Header banner={ banner } />
|
<Header banner={ banner } />
|
||||||
<SentryBoundary>
|
<SentryBoundary>
|
||||||
{ children }
|
{ children }
|
||||||
|
Loading…
Reference in New Issue
Block a user