Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the Impressum button conditionally #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions client/src/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ export const Menu: FC <{
}
}

const hasImpressum = lean4webConfig.impressum || lean4webConfig.contactDetails

return <div className='menu'>
<select
name="leanVersion"
Expand Down Expand Up @@ -218,13 +220,15 @@ export const Menu: FC <{
<NavButton icon={faArrowRotateRight} text="Restart server" onClick={restart} />
<NavButton icon={faDownload} text="Save file" onClick={() => save(code)} />
<NavButton icon={faShield} text={'Privacy policy'} onClick={() => {setPrivacyOpen(true)}} />
<NavButton icon={faInfoCircle} text={'Impressum'} onClick={() => {setImpressumOpen(true)}} />
{ hasImpressum &&
<NavButton icon={faInfoCircle} text={'Impressum'} onClick={() => {setImpressumOpen(true)}} />
}
<NavButton icon={faArrowUpRightFromSquare} text="Lean community" href="https://leanprover-community.github.io/" />
<NavButton icon={faArrowUpRightFromSquare} text="Lean documentation" href="https://leanprover.github.io/lean4/doc/" />
<NavButton icon={faArrowUpRightFromSquare} text="GitHub" href="https://github.com/hhu-adam/lean4web" />
</Dropdown>
<PrivacyPopup open={privacyOpen} handleClose={() => setPrivacyOpen(false)} />
{ (lean4webConfig.impressum || lean4webConfig.contactDetails) &&
{ hasImpressum &&
<ImpressumPopup open={impressumOpen} handleClose={() => setImpressumOpen(false)} />
}
<ToolsPopup open={toolsOpen} handleClose={() => setToolsOpen(false)} project={project} />
Expand Down