2019-01-13 01:52:43 +00:00
|
|
|
// @flow
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import Link from 'next/link';
|
2019-02-03 22:34:32 +00:00
|
|
|
import {
|
|
|
|
|
Container,
|
|
|
|
|
ButtonRowContainer,
|
|
|
|
|
Label,
|
|
|
|
|
Progression,
|
|
|
|
|
ProgressBar } from './style';
|
2019-01-13 01:52:43 +00:00
|
|
|
import { PrimaryButton, GhostButton } from '../Button';
|
2019-01-13 20:30:54 +00:00
|
|
|
import Logo from './Logo';
|
2019-01-13 01:52:43 +00:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
showHeaderShadow: boolean,
|
2019-02-03 22:34:32 +00:00
|
|
|
displayProgress: boolean,
|
|
|
|
|
totalItemsCount: number,
|
|
|
|
|
currentCount: number,
|
2019-01-13 01:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default function Header(props: Props) {
|
2019-02-03 22:34:32 +00:00
|
|
|
const { showHeaderShadow, totalItemsCount, currentCount, displayProgress } = props;
|
2019-01-13 01:52:43 +00:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Container showHeaderShadow={showHeaderShadow} data-cy="header">
|
|
|
|
|
<Link href="/">
|
|
|
|
|
<a style={{ display: 'flex', alignItems: 'center' }}>
|
2019-01-14 17:54:56 +00:00
|
|
|
<Label>Security Checklist</Label>
|
2019-01-13 20:30:54 +00:00
|
|
|
<Logo />
|
2019-01-13 01:52:43 +00:00
|
|
|
</a>
|
|
|
|
|
</Link>
|
|
|
|
|
|
2019-02-03 22:34:32 +00:00
|
|
|
<Progression isHidden={!displayProgress}>
|
|
|
|
|
{currentCount} of {totalItemsCount} completed
|
|
|
|
|
<ProgressBar />
|
|
|
|
|
</Progression>
|
|
|
|
|
|
2019-01-13 01:52:43 +00:00
|
|
|
<ButtonRowContainer>
|
|
|
|
|
<Link href="/about">
|
|
|
|
|
<a>
|
|
|
|
|
<GhostButton>About</GhostButton>
|
|
|
|
|
</a>
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/brianlovin/security-checklist"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
|
|
|
|
<PrimaryButton>Contribute</PrimaryButton>
|
|
|
|
|
</a>
|
|
|
|
|
</ButtonRowContainer>
|
|
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
}
|