-
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.
feat: Add global legal notice to all pages in Layout component
- Loading branch information
1 parent
422b1c3
commit c77d255
Showing
2 changed files
with
37 additions
and
1 deletion.
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,37 @@ | ||
import React, { useState } from 'react'; | ||
import LayoutProviders from '@theme/LayoutProviders'; | ||
import LegalNotice from '@site/src/components/LegalNotice'; | ||
|
||
export default function Layout(props) { | ||
const [showDisagreeMessage, setShowDisagreeMessage] = useState(false); | ||
|
||
if (showDisagreeMessage) { | ||
return ( | ||
<div style={{ | ||
padding: '2rem', | ||
maxWidth: '800px', | ||
margin: '0 auto', | ||
textAlign: 'center' | ||
}}> | ||
<h2>Access Restricted</h2> | ||
<p> | ||
Access to this website requires agreement to our terms of service and disclaimer. | ||
You have chosen not to agree, and therefore access is not available at this time. | ||
</p> | ||
<p> | ||
If you wish to discuss this further, please contact us at{' '} | ||
<a href="https://github.com/mainstreamorganization/mainstreamtoken/discussions"> | ||
GitHub Discussions | ||
</a>. | ||
</p> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<LayoutProviders> | ||
{props.children} | ||
<LegalNotice onDisagree={() => setShowDisagreeMessage(true)} /> | ||
</LayoutProviders> | ||
); | ||
} |