Skip to content

Commit bff1e14

Browse files
authored
Merge pull request #159 from PublicHealthEngland/development
New features and essential updates No conflict detected.
2 parents 840722d + cc8b1ce commit bff1e14

39 files changed

+1884
-989
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
![Build test for pull and push requests](https://github.com/PublicHealthEngland/coronavirus-dashboard/workflows/Build%20test%20for%20pull%20and%20push%20requests/badge.svg)
1+
# Coronavirus (COVID-19) in the UK
2+
3+
![Build test for pull and push requests](https://github.com/PublicHealthEngland/coronavirus-dashboard/workflows/Build%20test%20for%20pull%20and%20push%20requests/badge.svg) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/publichealthengland/coronavirus-dashboard) ![GitHub package.json version (branch)](https://img.shields.io/github/package-json/v/publichealthengland/coronavirus-dashboard/development) ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/publichealthengland/coronavirus-dashboard)
4+
25

36

47
This is the source code for the [Coronavirus Dashboard](https://coronavirus.data.gov.uk) service.
@@ -8,7 +11,9 @@ This is the source code for the [Coronavirus Dashboard](https://coronavirus.data
811
We welcome contributions by everyone. Please read the [contributions guide](https://github.com/PublicHealthEngland/coronavirus-dashboard/blob/master/CONTRIBUTING.md) for additional information.
912

1013
### How can I help?
11-
We have a [public project management board](https://github.com/orgs/PublicHealthEngland/projects/1) that shows outstanding issues to which everyone can contribute. Pick a ticket, assign it to yourself and move it to the **Doing** column, and you will be all set to start. Let us know if you need additional information. We are ready to help.
14+
We have a [public project management board](https://github.com/orgs/PublicHealthEngland/projects/1) that shows outstanding issues to which everyone can contribute. Pick a ticket, assign it to yourself and move it to the **Doing** column, and you will be all set to start. There is also the [outstanding issues](https://github.com/PublicHealthEngland/coronavirus-dashboard/issues) from which you can choose, but let us know that you are working on it so that multiple people don't end. up doing the same task.
15+
16+
No contribution is too small. We welcome help from everyone. Get in touch if you need additional information. We are here to help.
1217

1318
## Cloning the code for re-deployment
1419

@@ -28,5 +33,13 @@ You should also use the brand logo and font of your organisation.
2833

2934
Please consult the [GOV.UK Service Manual](https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk#if-your-service-isnt-on-govuk) for additional information.
3035

36+
### If you are re-deploying the website as a service
37+
38+
Please only clone our `master` branch for redeployment. All other contents, data, and branches that are either outside of the `master` branch or not otherwise used as a part of it - i.e. the associating assets - are copyrighted materials and therefore excluded from the MIT license until they receieve the necessary approvals to be merged.
39+
40+
Please note that other branches may contain experimental development contents and prototypes. We routinely create such materials so that they can be discussed, improved, and be put forward for approval purposes.
41+
42+
You are welcome to use the `development` branch as describeed in the [Contributors' Guide](https://github.com/PublicHealthEngland/coronavirus-dashboard/blob/master/CONTRIBUTING.md) to help us improve the service and make a contribution.
43+
3144
## Credits
3245
This service is developed and maintained by [NHSX](https://www.nhsx.nhs.uk/) and [Public Health England](https://www.gov.uk/government/organisations/public-health-england).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "covid-public",
3-
"version": "1.5.5",
3+
"version": "1.6.0",
44
"private": true,
55
"homepage": "https://coronavirus.data.gov.uk/",
66
"dependencies": {

src/App.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const FooterContents = () => {
4444
}; // FooterContents
4545

4646

47-
const F = props => <Footer
48-
{ ...props }
47+
const F = () => <Footer
48+
4949
meta={ {
5050
children: <FooterContents/>,
5151
items: [
@@ -61,7 +61,7 @@ const F = props => <Footer
6161
const App = () => {
6262

6363
return (
64-
<>
64+
<Fragment>
6565
<CookieBanner/>
6666
<Header
6767
// containerClassName="govuk-header__container--full-width"
@@ -76,8 +76,8 @@ const App = () => {
7676
<Switch>
7777
{/* These back-to-top links are the 'overlay' style that stays
7878
on screen as we scroll. */}
79-
<Route path="/about" exact render={()=>(<BackToTop mode="overlay"/>)} />
80-
<Route path="/" exact render={()=>(<BackToTop mode="overlay"/>)} />
79+
<Route path="/about" exact render={ () => <BackToTop mode={ "overlay" }/> } />
80+
<Route path="/" exact render={ () => <BackToTop mode={ "overlay" }/> } />
8181
</Switch>
8282

8383
<Switch>
@@ -94,18 +94,19 @@ const App = () => {
9494
<Switch>
9595
{/* These back-to-top links are the 'inline' style that sits
9696
statically between the end of the content and the footer. */}
97-
<Route path="/about" exact render={()=>(<BackToTop mode="inline"/>)} />
98-
<Route path="/" exact render={()=>(<BackToTop mode="inline"/>)} />
97+
<Route path="/about" exact render={ props => <BackToTop {...props} mode="inline"/> } />
98+
<Route path="/" exact render={ props => <BackToTop {...props} mode="inline"/> } />
9999
</Switch>
100100

101101
<Switch>
102+
<Route path="/region" component={ F }/>
102103
<Route path="/" exact component={ F }/>
103104
<Route path="/about" exact component={ F }/>
104105
<Route path="/accessibility" exact component={ F }/>
105106
<Route path="/cookies" exact component={ F }/>
106107
<Route path="/archive" exact component={ F }/>
107108
</Switch>
108-
</>
109+
</Fragment>
109110
);
110111
}
111112

src/components/BackToTop/BackToTop.js

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,39 @@ import * as Styles from './BackToTop.styles';
88

99
import useBackToTopOverlayVisible from 'hooks/useBackToTopOverlayVisible';
1010

11+
12+
const backToTopClickHandler = event => {
13+
14+
event.preventDefault();
15+
16+
window.scrollTo(0, 0);
17+
18+
}; // backToTopClickHandler
19+
20+
1121
const BackToTopLink: ComponentType<Props> = () => {
12-
return (
13-
<div class="govuk-width-container">
14-
<a class="govuk-link govuk-link--no-visited-state" href="#top">
15-
<svg role="presentation" focusable="false" class="back-to-top" xmlns="http://www.w3.org/2000/svg" width="13" height="17" viewBox="0 0 13 17">
16-
<path fill="currentColor" d="M6.5 0L0 6.5 1.4 8l4-4v12.7h2V4l4.3 4L13 6.4z"></path>
17-
</svg>Back to top
18-
</a>
22+
23+
return <div className={ "govuk-width-container" }>
24+
<Styles.Link className={ "govuk-link govuk-link--no-visited-state" }
25+
role={ "button" }
26+
href={ "" }
27+
onClick={ backToTopClickHandler }>
28+
<svg role={ "presentation" }
29+
focusable={ "false" }
30+
className={ "back-to-top" }
31+
xmlns={ "http://www.w3.org/2000/svg" }
32+
width={ "13" }
33+
height={ "17" }
34+
viewBox={ "0 0 13 17" }>
35+
<path fill={ "currentColor" }
36+
d={ "M6.5 0L0 6.5 1.4 8l4-4v12.7h2V4l4.3 4L13 6.4z" }/>
37+
</svg>
38+
Back to top
39+
</Styles.Link>
1940
</div>
20-
);
21-
};
41+
42+
}; // BackToTopLink
43+
2244

2345
/**
2446
* A govuk style back-to-top link component.
@@ -31,20 +53,24 @@ const BackToTopLink: ComponentType<Props> = () => {
3153
* display this component.
3254
*/
3355
const BackToTop: ComponentType<Props> = ({ mode }: Props) => {
34-
const visible = useBackToTopOverlayVisible('footer');
35-
if (mode === 'overlay'){
36-
return (
37-
<Styles.OverlayContainer style={{opacity: visible ? 1 : 0}}>
38-
<BackToTopLink />
56+
57+
const visible = useBackToTopOverlayVisible('footer');
58+
59+
if ( mode === 'overlay' ) {
60+
61+
return<Styles.OverlayContainer style={ { opacity: visible ? 1 : 0 } }>
62+
<BackToTopLink/>
3963
</Styles.OverlayContainer>
40-
);
41-
} else {
42-
return (
43-
<Styles.InlineContainer style={{opacity: visible ? 0 : 1}}>
44-
<BackToTopLink />
64+
65+
} else {
66+
67+
return <Styles.InlineContainer style={ { opacity: visible ? 0 : 1 } }>
68+
<BackToTopLink/>
4569
</Styles.InlineContainer>
46-
);
70+
4771
}
48-
};
72+
73+
}; // BackToTop
74+
4975

5076
export default BackToTop;

src/components/BackToTop/BackToTop.styles.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ export const InlineContainer: ComponentType<*> = (() => {
2323
margin-bottom: 40px;
2424
`;
2525
})();
26+
27+
28+
export const Link: ComponentType<*> = (() => {
29+
return styled.a`
30+
background: rgba(255, 255, 255, .8);
31+
padding: .5em .5em 2em .5em;
32+
`;
33+
})();
Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
// @flow
22

3-
import React from 'react';
4-
import type { ComponentType } from 'react';
3+
import React, { Component } from 'react';
54
import numeral from 'numeral';
65

76
import type { Props } from './BigNumber.types.js';
87
import * as Styles from './BigNumber.styles.js';
98

10-
const BigNumber: ComponentType<Props> = ({ caption, number, description, asterisk }: Props) => {
11-
return (
12-
<Styles.Container>
13-
<Styles.Caption className="govuk-heading-m">{caption}</Styles.Caption>
14-
<Styles.Number className="govuk-heading-l">{numeral(number).format('0,0')}{asterisk ? '*' : ''}</Styles.Number>
15-
<Styles.Caption className="govuk-body govuk-!-font-size-16 govuk-!-margin-bottom-1">{description}</Styles.Caption>
16-
</Styles.Container>
17-
);
18-
};
199

20-
export default BigNumber;
10+
export const BigNumberContainer: Component<Props> = ({ children }) => {
11+
12+
return <Styles.MainContainer>
13+
<Styles.Children>{ children }</Styles.Children>
14+
</Styles.MainContainer>
15+
16+
}; // SmallNumberContainer
17+
18+
19+
export const BigNumber: Component<Props> = ({ caption, number, description }: Props) => {
20+
return (
21+
<Styles.Container>
22+
<Styles.Caption className="govuk-caption-l">{ caption }</Styles.Caption>
23+
<Styles.Number
24+
className="govuk-heading-l">{ numeral(number).format('0,0') }</Styles.Number>
25+
<Styles.Description
26+
className="govuk-body govuk-!-font-size-16 govuk-!-margin-bottom-1">
27+
{ description }
28+
</Styles.Description>
29+
</Styles.Container>
30+
);
31+
};

src/components/BigNumber/BigNumber.styles.js

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,85 @@ import type { ComponentType } from 'react';
66
import addIECss from 'addIECss';
77

88
export const Container: ComponentType<*> = (() => {
9-
return styled.div`
9+
return styled.div`
1010
display: flex;
1111
flex-direction: column;
1212
border-top: 1px solid #b1b4b6;
1313
padding-top: 20px;
14-
grid-column: span 3;
15-
16-
${addIECss(css`
17-
width: 48%;
18-
`)}
14+
grid-column: span 1;
15+
margin-bottom: 2rem;
16+
17+
@media only screen and (max-width: 768px) {
18+
&:nth-child(n+1) {
19+
margin-right: 0;
20+
}
21+
}
22+
23+
${ addIECss(css`
24+
width: 100%;
25+
`) }
1926
`;
2027
})();
2128

29+
2230
export const Caption: ComponentType<*> = (() => {
23-
return styled.div`
24-
height: 2.75rem;
25-
font-size: 1.19rem;
31+
return styled.h2`
2632
margin-bottom: 5px;
33+
color: black;
34+
font-size: 20px;
35+
font-weight: bold;
2736
`;
2837
})();
2938

39+
40+
export const Description: ComponentType<*> = (() => {
41+
return styled.p`
42+
margin: 0;
43+
color: #626a6e;
44+
`;
45+
})();
46+
47+
3048
export const Number: ComponentType<*> = (() => {
31-
return styled.div`
32-
font-size: 2.25rem;
49+
return styled.span`
3350
margin-bottom: 10px;
3451
color: #367E93;
3552
`;
3653
})();
3754

38-
export const PercentageChange: ComponentType<*> = (() => {
39-
return styled.span`
40-
margin-bottom: 0;
41-
font-size: 18px;
42-
`;
43-
})();
4455

45-
export const Triangle: ComponentType<*> = (() => {
46-
return styled.div``;
56+
export const MainContainer: ComponentType<*> = (() => {
57+
58+
return styled.section`
59+
grid-column: 1/-1;
60+
61+
${ addIECss(css`
62+
width: 100%;
63+
`) }
64+
`
65+
4766
})();
4867

49-
export const Subtext: ComponentType<*> = (() => {
50-
return styled.span``;
68+
69+
export const Children: ComponentType<*> = (() => {
70+
return styled.div`
71+
grid-column: 1/-1;
72+
width: 100%;
73+
display: flex;
74+
flex-direction: row;
75+
flex-wrap: wrap;
76+
justify-content: space-between;
77+
&>* {
78+
width: 48%;
79+
}
80+
81+
@media only screen and (max-width: 768px) {
82+
align-items: stretch;
83+
flex-direction: column;
84+
85+
&>* {
86+
width: 100%;
87+
}
88+
}
89+
`;
5190
})();

src/components/BigNumber/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './BigNumber';
1+
export { BigNumberContainer, BigNumber } from './BigNumber';

0 commit comments

Comments
 (0)