Skip to content

Commit

Permalink
feat: Add global legal notice to all pages in Layout component
Browse files Browse the repository at this point in the history
  • Loading branch information
aidamiscom committed Jan 4, 2025
1 parent 422b1c3 commit c77d255
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ export default function Home(): JSX.Element {
<Tokenomics />
</main>
<FooterWarning />
<LegalNotice onDisagree={() => setShowDisagreeMessage(true)} />
</Layout>
);
}
37 changes: 37 additions & 0 deletions src/theme/Layout/index.tsx
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>
);
}

0 comments on commit c77d255

Please sign in to comment.