Skip to content

Commit

Permalink
O3-1294:User should be able to navigate back to username screen (#449)
Browse files Browse the repository at this point in the history
* O3-1294:User should be able to navigate back to username screen

* O3-1294:User should be able to navigate back to username screen

* O3-1294:User should be able to navigate back to username screen

* fixed the styles for the back button

Co-authored-by: jwnasambu <julietwamalwa@yahoo.com>
  • Loading branch information
jwnasambu and jwamalwa authored Jun 7, 2022
1 parent f190b3d commit dca9f42
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/apps/esm-login-app/src/login/login.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useRef, useEffect, useCallback } from "react";
import styles from "../styles.scss";
import ArrowRight24 from "@carbon/icons-react/es/arrow--right/24";
import ArrowLeft16 from "@carbon/icons-react/es/arrow--left/16";
import {
Button,
InlineNotification,
Expand Down Expand Up @@ -148,6 +149,19 @@ const Login: React.FC<LoginProps> = ({ history, location, isLoginEnabled }) => {
onClick={() => setErrorMessage("")}
/>
)}
{showPassword ? (
<div style={{ width: "23rem" }}>
<Button
className={styles["back-button"]}
kind="ghost"
iconDescription="Back to username"
onClick={() => history.push("/login")}
>
<ArrowLeft16 style={{ marginRight: "1rem" }} />
Back
</Button>
</div>
) : null}
<Tile className={styles["login-card"]}>
<div className={styles["center"]}>{logo}</div>
<form onSubmit={handleSubmit} ref={formRef}>
Expand Down
8 changes: 8 additions & 0 deletions packages/apps/esm-login-app/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@
width: 18rem;
}

.back-button {
height: 3rem;

svg {
margin-right: 0.5rem;
}
}

.inputStyle {
@extend .label01;
width: 18rem;
Expand Down
1 change: 1 addition & 0 deletions packages/apps/esm-login-app/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"back": "back",
"change": "Change",
"confirm": "Confirm",
"contactAdmin": "Contact the site administrator",
Expand Down

0 comments on commit dca9f42

Please sign in to comment.