Skip to content

Commit

Permalink
Merge pull request #199 from adhocteam/dcloud/67-welcome-placard
Browse files Browse the repository at this point in the history
Add design to Login page
  • Loading branch information
dcloud authored Mar 1, 2021
2 parents 11f5258 + ad65fdd commit ad27298
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 22 deletions.
12 changes: 12 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ body {
background-color: #f8f8f8;
}

.smart-hub-bg-blue-primary {
background-color: #0166ab;
}

.smart-hub-border-blue-primary {
border-color: #0166ab;
}

.smart-hub-maxw-placard {
max-width: 34.25rem;
}

.height-12 {
height: 6.5em;
}
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/__tests__/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import fetchMock from 'fetch-mock';
import App from '../App';

describe('App', () => {
const loginText = 'Log In with HSES';

afterEach(() => fetchMock.restore());
const userUrl = join('api', 'user');
const logoutUrl = join('api', 'logout');
Expand All @@ -27,7 +29,7 @@ describe('App', () => {
it('can log the user out when "logout" is pressed', async () => {
const logout = await screen.findByText('Logout');
fireEvent.click(logout);
expect(await screen.findByText('HSES Login')).toBeVisible();
expect(await screen.findByText(loginText)).toBeVisible();
expect(await screen.findByText('Logout Successful')).toBeVisible();
});
});
Expand All @@ -39,7 +41,7 @@ describe('App', () => {
});

it('displays the login button', async () => {
expect(await screen.findByText('HSES Login')).toBeVisible();
expect(await screen.findByText(loginText)).toBeVisible();
});
});

Expand All @@ -50,7 +52,7 @@ describe('App', () => {
});

it('displays the login button for now. in the future this should show the "request permissions" UI', async () => {
expect(await screen.findByText('HSES Login')).toBeVisible();
expect(await screen.findByText(loginText)).toBeVisible();
});
});
});
Binary file added frontend/src/images/eclkc-blocks-logo-156.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 frontend/src/images/eclkc-blocks-logo-78.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/pages/Unauthenticated/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Unauthenticated Page', () => {
});

test('displays welcome message', () => {
expect(screen.getByText('Welcome to the TTA Smart Hub!')).toBeVisible();
expect(screen.getByText('Welcome to the TTA Smart Hub')).toBeVisible();
});

test('does not display the logged out message', () => {
Expand Down
59 changes: 41 additions & 18 deletions frontend/src/pages/Unauthenticated/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import PropTypes from 'prop-types';
import {
Link, Alert,
} from '@trussworks/react-uswds';
import Container from '../../components/Container';

import logo1x from '../../images/eclkc-blocks-logo-78.png';
import logo2x from '../../images/eclkc-blocks-logo-156.png';

function Unauthenticated({ loggedOut, timedOut }) {
let msg = 'You have successfully logged out of the TTA Smart Hub';
Expand All @@ -17,23 +19,44 @@ function Unauthenticated({ loggedOut, timedOut }) {
}

return (
<Container>
{loggedOut
&& (
<Alert type={type} heading={heading}>
{msg}
</Alert>
)}
<h1>
Welcome to the TTA Smart Hub!
</h1>
<p>
Login via HSES to continue
</p>
<Link referrerPolicy="same-origin" className="usa-button" variant="unstyled" href="/api/login">
HSES Login
</Link>
</Container>
<>
<div className="smart-hub-dimmer position-fixed top-0 right-0 bottom-0 left-0 z-auto bg-ink opacity-50" />
<div role="dialog" aria-labelledby="welcome-message" aria-describedby="login-description" className="position-relative smart-hub-maxw-placard margin-x-auto margin-top-7 z-top bg-white border-top-2 smart-hub-border-blue-primary">
<div className="maxw-mobile margin-x-auto padding-y-7">
<img src={logo1x} srcSet={`${logo2x} 2x`} width="78" height="78" alt="ECLKC Blocks Logo" className="smart-hub-logo display-block margin-x-auto" />
<h1 id="welcome-message" className="font-serif-xl text-center margin-4">
Welcome to the TTA Smart Hub
</h1>
{loggedOut
&& (
<Alert type={type} heading={heading}>
{msg}
</Alert>
)}
<div className="text-center margin-top-4">
<p id="login-description">
You must log in with HSES in order to access the Office of Head Start TTA Smart Hub.
</p>
<Link referrerPolicy="same-origin" className="usa-button smart-hub-bg-blue-primary display-block margin-x-1 margin-top-4" variant="unstyled" href="/api/login">
Log In with HSES
</Link>
<div className="margin-top-9">
<p className="text-bold">
First time logging in?
</p>
<p>
You must request permission in order to use the TTA Smart Hub.
</p>
<p>
<a href="https://app.smartsheetgov.com/b/form/f0b4725683f04f349a939bd2e3f5425a">
Request Permission
</a>
</p>
</div>
</div>
</div>
</div>
</>
);
}

Expand Down

0 comments on commit ad27298

Please sign in to comment.