Skip to content

Commit

Permalink
Merge pull request #459 from masakudamatsu/login-screen
Browse files Browse the repository at this point in the history
Add the app's logo etc.
  • Loading branch information
masakudamatsu authored Jun 4, 2023
2 parents d39eb22 + ffe8f5c commit 7a8abac
Show file tree
Hide file tree
Showing 35 changed files with 439 additions and 266 deletions.
3 changes: 2 additions & 1 deletion cypress/e2e/auth.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
renewalPage,
signupPage,
subscribePage,
successPage,
} from '../../src/utils/uiCopies';

import {
Expand Down Expand Up @@ -188,7 +189,7 @@ describe('Subscribed users', () => {
});
it('can visit the app after successful payment', () => {
cy.visit('/success');
cy.findByText(subscribePage.success.buttonLabel).click();
cy.findByText(successPage.buttonLabel).click();
cy.url().should('eq', `${Cypress.config().baseUrl}/`);
});
it('will not get redirected from signup page to the app', () => {
Expand Down
3 changes: 3 additions & 0 deletions public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions public/logo-full-day.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions public/logo-full-night.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/maskable_icon_x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/maskable_icon_x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/saved-place-mark-day.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/saved-place-mark-night.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "My Ideal Map",
"short_name": "My Ideal Map",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/maskable_icon_x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/maskable_icon_x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
29 changes: 16 additions & 13 deletions src/components/Controls.test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// eslint-disable-next-line no-unused-vars
import {render, screen} from '@testing-library/react';
import {axe} from 'jest-axe';
// TODO #461: Fix this test file
test('dummy test', () => {});

import {Controls} from './Controls';
// // eslint-disable-next-line no-unused-vars
// import {render, screen} from '@testing-library/react';
// import {axe} from 'jest-axe';

const mockProps = {
mapObject: {},
};
// import {Controls} from './Controls';

test.skip('Accessibility checks', async () => {
const {container} = render(<Controls {...mockProps} />);
screen.debug();
const results = await axe(container);
expect(results).toHaveNoViolations();
});
// const mockProps = {
// mapObject: {},
// };

// test.skip('Accessibility checks', async () => {
// const {container} = render(<Controls {...mockProps} />);
// screen.debug();
// const results = await axe(container);
// expect(results).toHaveNoViolations();
// });
26 changes: 26 additions & 0 deletions src/components/Logo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {useContext, useEffect, useState} from 'react';
import Image from 'next/image';
import logoDay from '../../public/logo-full-day.svg';
import logoNight from '../../public/logo-full-night.svg';

import {NightModeContext} from 'src/wrappers/NightModeContext';

// import PropTypes from 'prop-types';

export const Logo = () => {
const [clientSideRendering, setClientSideRendering] = useState(false);
useEffect(() => {
setClientSideRendering(true);
}, []);
const nightMode = useContext(NightModeContext);
const logoFilePath = nightMode ? logoNight : logoDay;
return (
clientSideRendering && (
<div data-logo>
<Image alt="" data-logo fill priority src={logoFilePath} />
</div>
)
);
};

// Logo.propTypes = {};
24 changes: 24 additions & 0 deletions src/components/Logo.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// TODO #461: Fix this test file
test('dummy test', () => {});

// // eslint-disable-next-line no-unused-vars
// import {render, screen} from '@testing-library/react';
// import {axe} from 'jest-axe';

// import {Logo} from './Logo';

// const mockProps = {};

// // describe(``, () => {
// // beforeEach(() => {
// // render(<Logo {...mockProps} />);
// // });
// // test(``, () => {
// // });
// // });

// test('Accessibility checks', async () => {
// const {container} = render(<Logo {...mockProps} />);
// const results = await axe(container);
// expect(results).toHaveNoViolations();
// });
8 changes: 6 additions & 2 deletions src/components/MenuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {useOnClickOutside} from 'src/hooks/useOnClickOutside';
import {useOnEscKeyDown} from 'src/hooks/useOnEscKeyDown';

import {CloseButton} from './CloseButton';
import {Logo} from './Logo';

import {Button} from 'src/elements/Button';
import {DivMenuBackground} from 'src/elements/DivMenuBackground';
import {H2} from 'src/elements/H2';
import {ListMenu} from 'src/elements/ListMenu';
import {ParagraphMenu} from 'src/elements/ParagraphMenu';
import {SpanRipple} from 'src/elements/SpanRipple';
Expand All @@ -24,6 +24,7 @@ import {SvgFlightTakeoff} from 'src/elements/SvgFlightTakeoff';
import {SvgLogout} from 'src/elements/SvgLogout';
import {SvgRefresh} from 'src/elements/SvgRefresh';
import {SvgSearch} from 'src/elements/SvgSearch';
import {VisuallyHidden} from 'src/elements/VisuallyHidden';

import {buttonLabel, menuLabel} from 'src/utils/uiCopies';
import {statusType} from 'src/utils/type';
Expand Down Expand Up @@ -142,7 +143,10 @@ export const MenuButton = ({
aria-labelledby="menu-label"
ref={menu}
>
<H2 id="menu-label">{menuLabel}</H2>
<Logo />
<VisuallyHidden as="h2" id="menu-label">
{menuLabel}
</VisuallyHidden>
<CloseButton
ariaLabel={buttonLabel.close}
handleClick={handleClickCloseButton}
Expand Down
Loading

1 comment on commit 7a8abac

@vercel
Copy link

@vercel vercel bot commented on 7a8abac Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.