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

Add page-wide footer with Impressum and Datenschutz #498

Merged
merged 11 commits into from
Jul 21, 2024
Merged
3 changes: 3 additions & 0 deletions src/App.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ test.each([
...['date-converter', 'list-of-kings'].map((tabId) => '/about/' + tabId),
'/signs',
'/signs/sign_id',
'/impressum',
'/datenschutz',
])('%s renders without crashing', async (route) => {
window.scrollTo = jest.fn()
const fakeApi = new FakeApi().allowStatistics(statisticsFactory.build())
const appDriver = new AppDriver(fakeApi.client).withPath(route).render()
await appDriver.waitForTextToDisappear('Loading...')
Expand Down
18 changes: 18 additions & 0 deletions src/Footer.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.main-footer
max-width: 1200px
padding-left: 1.5em
padding-right: 1.5em
margin-left: auto
margin-right: auto

ol.breadcrumb
& li a
padding: 0
display: inline
& li+li
padding-left: .5rem
&::before
display: inline-block
padding-right: .5rem
color: #6c757d
content: "|"
14 changes: 14 additions & 0 deletions src/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'
import './Footer.sass'
import { NavItem } from 'Header'

export default function Footer(): JSX.Element {
return (
<footer className="main-footer">
<ol className="breadcrumb">
<NavItem href="/impressum" title="Impressum" as={'li'} />
<NavItem href="/datenschutz" title="Datenschutz" as={'li'} />
</ol>
</footer>
)
}
16 changes: 12 additions & 4 deletions src/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ function EblLogo(): JSX.Element {
)
}

function NavItem(props: { href: string; title: string }): JSX.Element {
export function NavItem({
href,
title,
as,
}: {
href: string
title: string
as?: React.ElementType
}): JSX.Element {
return (
<Nav.Item>
<LinkContainer to={props.href}>
<Nav.Link>{props.title}</Nav.Link>
<Nav.Item as={as}>
<LinkContainer to={href}>
<Nav.Link>{title}</Nav.Link>
</LinkContainer>
</Nav.Item>
)
Expand Down
4 changes: 4 additions & 0 deletions src/NotFoundPage.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.page-not-found
text-align: center
margin-top: 50px
min-height: 90vh
3 changes: 2 additions & 1 deletion src/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react'
import './NotFoundPage.sass'

const NotFoundPage: React.FC = () => (
<div style={{ textAlign: 'center', marginTop: '50px' }}>
<div className="page-not-found">
<h1>404 - Not Found</h1>
<p>The page you are looking for does not exist.</p>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/common/AppContent.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
padding-bottom: 1em
padding-left: 1.5em
padding-right: 1.5em
min-height: 90vh

&--wide
max-width: initial
Expand All @@ -15,7 +16,7 @@
display: flex
flex-flow: wrap
margin-bottom: 1em

&__breadcrumbs
flex: 0 0 100%

Expand All @@ -33,7 +34,7 @@
background: #417DD2
background-blend-mode: lighten
background-image: url(https://www.ebl.lmu.de/api/images/Babel_Project_01_cropped.svg)
background-position: right -12em bottom
background-position: right -12em bottom
background-repeat: no-repeat
background-size: 20em
color: #FFFFFF
Expand Down
Loading
Loading