Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #27 from madetech/showcase/29_jan-initial
Browse files Browse the repository at this point in the history
Showcase/29 jan initial
  • Loading branch information
zackads authored Jan 28, 2021
2 parents 73800d9 + 199a2b0 commit 0c6a84a
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 250 deletions.
2 changes: 1 addition & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Footer: React.FC = () => (
/>
</svg>
<span className="govuk-footer__licence-description">
All content is available under the
All content is available under the &nbsp;
<a
className="govuk-footer__link"
href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
Expand Down
15 changes: 8 additions & 7 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ export const Header: React.FC<HeaderProps> = ({
fillRule="evenodd"
d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2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-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"
/>
<img
alt="GovUK Crown logo"
src="/assets/images/govuk-logotype-crown.png"
className="govuk-header__logotype-crown-fallback-image"
width="36"
height="32"
/>
{/* TODO: https://github.com/madetech/mca-beacons-webapp/issues/26 */}
{/*<img*/}
{/* alt="GovUK Crown logo"*/}
{/* src="/assets/images/govuk-logotype-crown.png"*/}
{/* className="govuk-header__logotype-crown-fallback-image"*/}
{/* width="36"*/}
{/* height="32"*/}
{/*/>*/}
</svg>
<span className="govuk-header__logotype-text">GOV.UK</span>
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PhaseBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const PhaseBanner: React.FC<PhaseBannerProps> = ({
phase,
bannerHtml,
}: PhaseBannerProps): JSX.Element => (
<div className="govuk-phase-banner">
<div className="govuk-phase-banner govuk-width-container">
<p className="govuk-phase-banner__content">
<strong className="govuk-tag govuk-phase-banner__content__tag">
{phase}
Expand Down
54 changes: 54 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from "react";
import Document, {
Html,
Head,
Main,
NextScript,
DocumentContext,
} from "next/document";
import { DocumentInitialProps } from "next/dist/next-server/lib/utils";
import { Header } from "../components/Header";
import { PhaseBanner } from "../components/PhaseBanner";
import { Footer } from "../components/Footer";

class GovUKTemplate extends Document {
static async getInitialProps(
ctx: DocumentContext
): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}

render(): React.ReactElement {
return (
// TODO: https://github.com/madetech/mca-beacons-webapp/issues/25
<Html className={"govuk-template "}>
<Head>
<title>
Maritime & Coastguard Agency - Beacons registration service
</title>
</Head>
<body className={"govuk-template__body"}>
<Header serviceName={"Beacon registration service"} homeLink={"#"} />
<PhaseBanner
phase={"BETA"}
bannerHtml={
<>
This is a new MCA Show and Tell on 29 January 2021 – your{" "}
<a className="govuk-link" href="#">
feedback
</a>{" "}
will help us to improve it.
</>
}
/>
<Main />
<Footer />
<NextScript />
</body>
</Html>
);
}
}

export default GovUKTemplate;
97 changes: 46 additions & 51 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,57 @@
import React, { FunctionComponent } from "react";
import { Header } from "../components/Header";
import { Footer } from "../components/Footer";
import { PhaseBanner } from "../components/PhaseBanner";

const Home: FunctionComponent = () => {
return (
<div className={"govuk-template__body"}>
<Header serviceName={"Beacon registration service"} homeLink={"#"} />;
<main className={"govuk-width-container"}>
<PhaseBanner
phase={"BETA"}
bannerHtml={
<>
This is a new MCA Show and Tell on 29 January 2021 – your{" "}
<a className="govuk-link" href="#">
feedback
</a>{" "}
will help us to improve it.
</>
}
/>
<div className={"govuk-main-wrapper"}>
<h1 className="govuk-heading-l">Beacon registration service</h1>
<div className={"govuk-width-container"}>
<main className={"govuk-main-wrapper"}>
<h1 className="govuk-heading-l">Beacon registration service</h1>

<p className="govuk-body">Use this service to:</p>
<p className="govuk-body">Use this service to:</p>

<ul className="govuk-list govuk-list--bullet">
<li>
showcase your continuous integration and deployment pipeline
</li>
<li>
talk about reusable React components that will speed up future
sprints
</li>
</ul>
<a
href="#"
role="button"
draggable="false"
className="govuk-button govuk-!-margin-top-2 govuk-!-margin-bottom-8 govuk-button--start"
data-module="govuk-button"
>
Start now
<svg
className="govuk-button__start-icon"
xmlns="http://www.w3.org/2000/svg"
width="17.5"
height="19"
viewBox="0 0 33 40"
aria-hidden="true"
focusable="false"
<ul className="govuk-list govuk-list--bullet">
<li>
<a
href={"https://github.com/madetech/mca-beacons-webapp/actions"}
target={"_blank"}
rel={"noreferrer"}
>
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
</svg>
</a>
</div>
showcase
</a>{" "}
your{" "}
<a
href={
"https://github.com/madetech/mca-beacons-integration/actions"
}
target={"_blank"}
rel={"noreferrer"}
>
continuous integration and deployment pipeline
</a>
</li>
<li>
talk about reusable{" "}
<a
href={"https://design-system.service.gov.uk/"}
target={"_blank"}
rel={"noreferrer"}
>
GOV.UK design system
</a>{" "}
components that will speed up future sprints
</li>
<li>
outline the{" "}
<a
href={"https://miro.com/app/board/o9J_lZRBWY4=/"}
target={"_blank"}
rel={"noreferrer"}
>
data model
</a>{" "}
as we currently understand it
</li>
</ul>
</main>
<Footer />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion test/components/__snapshots__/Footer.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`Footer renders correctly 1`] = `
<span
class="govuk-footer__licence-description"
>
All content is available under the
All content is available under the  
<a
class="govuk-footer__link"
href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
Expand Down
7 changes: 0 additions & 7 deletions test/components/__snapshots__/Header.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ exports[`Header renders correctly 1`] = `
fill="currentColor"
fill-rule="evenodd"
/>
<img
alt="GovUK Crown logo"
class="govuk-header__logotype-crown-fallback-image"
height="32"
src="/assets/images/govuk-logotype-crown.png"
width="36"
/>
</svg>
<span
class="govuk-header__logotype-text"
Expand Down
2 changes: 1 addition & 1 deletion test/components/__snapshots__/PhaseBanner.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`PhaseBanner with snapshots renders the Phase Banner correctly 1`] = `
<DocumentFragment>
<div
class="govuk-phase-banner"
class="govuk-phase-banner govuk-width-container"
>
<p
class="govuk-phase-banner__content"
Expand Down
Loading

0 comments on commit 0c6a84a

Please sign in to comment.