Skip to content

Commit

Permalink
Display the Impressum button conditionally (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: sandreckoner <sandreckoner@moving-reference-frame>
  • Loading branch information
despresc and sandreckoner authored Jan 13, 2025
1 parent cb86424 commit 137995c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/src/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export const Menu: FC <{
}
}

const hasImpressum = lean4webConfig.impressum || lean4webConfig.contactDetails

return <div className='menu'>
<select
name="leanVersion"
Expand Down Expand Up @@ -220,13 +222,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

0 comments on commit 137995c

Please sign in to comment.