-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ASAP-378] - display AnalyticsMobilePage when mobile width (#4224)
* display AnayticsMobilePage when mobile width * update Analytics page tests * modify css instead * modify paddingTop * remove debug * headline fontsize should be 26
- Loading branch information
Showing
5 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* istanbul ignore file */ | ||
|
||
const desktop = ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={40} | ||
height={37} | ||
viewBox="0 0 40 37" | ||
fill="none" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M0.5 2C0.5 1.17157 1.17157 0.5 2 0.5H38C38.8284 0.5 39.5 1.17157 39.5 2V27.5C39.5 28.3284 38.8284 29 38 29H21.5V33.5H28C28.8284 33.5 29.5 34.1716 29.5 35C29.5 35.8284 28.8284 36.5 28 36.5H12C11.1716 36.5 10.5 35.8284 10.5 35C10.5 34.1716 11.1716 33.5 12 33.5H18.5V29H2C1.17157 29 0.5 28.3284 0.5 27.5V2ZM3.5 3.5V26H36.5V3.5H3.5Z" | ||
fill="#00202C" | ||
/> | ||
</svg> | ||
); | ||
|
||
export default desktop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/react-components/src/templates/AnalyticsMobilePage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import { Paragraph } from '../atoms'; | ||
import { rem } from '../pixels'; | ||
import { deskTopIcon } from '../icons'; | ||
|
||
const containerStyles = css({ | ||
padding: `30vh ${rem(24)} 0`, | ||
textAlign: 'center', | ||
}); | ||
|
||
const headlineStyles = css({ | ||
fontSize: '26px', | ||
margin: '16px 0', | ||
}); | ||
const AnalyticsMobilePage: React.FC = () => ( | ||
<header css={containerStyles}> | ||
<div>{deskTopIcon}</div> | ||
<h3 css={headlineStyles}> | ||
Analytics are only available on the desktop version. | ||
</h3> | ||
<Paragraph accent="lead"> | ||
To access all analytics features, please use the desktop version. We | ||
apologize for any inconvenience this may cause. | ||
</Paragraph> | ||
</header> | ||
); | ||
|
||
export default AnalyticsMobilePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/react-components/src/templates/__tests__/AnalyticsMobilePage.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
import AnalyticsMobilePage from '../AnalyticsMobilePage'; | ||
|
||
it('renders the page', () => { | ||
render(<AnalyticsMobilePage />); | ||
expect( | ||
screen.getByText(/Analytics are only available/, { selector: 'h3' }), | ||
).toBeVisible(); | ||
}); |