Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Issue: #369 #380

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions packages/react/src/components/auth/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { loginModalStore } from '../../store';
import { useRCAuth } from '../../hooks/useRCAuth';
import { Button } from '../Button';
import { Box } from '../Box';
import { Input } from '../Input';
import { Input } from '../Input'

export default function LoginForm() {
const [userOrEmail, setuserOrEmail] = useState(null);
Expand All @@ -30,6 +30,15 @@ export default function LoginForm() {
setpassword(e.target.value);
};

const togglePassword = () => {
const x = document.getElementById('password');
if (x.type === 'password') {
x.type = 'text';
} else {
x.type = 'password';
}
}

const fieldCSS = css`
display: flex;
flex-flow: column nowrap;
Expand Down Expand Up @@ -63,7 +72,12 @@ export default function LoginForm() {
-webkit-margin-after: 0.125rem;
margin-block-end: 0.125rem;
`;


const eyeCss = css`
cursor: pointer;
margin-left: 0.5rem;
margin-right: 0.5rem;
`;
return isLoginModalOpen ? (
<>
<GenericModal
Expand All @@ -87,7 +101,22 @@ export default function LoginForm() {
<Box css={fieldCSS}>
<Box css={fieldLabel}>Password</Box>
<Box css={fieldRow}>
<Input type="password" onChange={handleEditPassword} />
<Input type="password" id="password" onChange={handleEditPassword} />
<Box type="button" css={eyeCss} onClick={togglePassword}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="23"
height="23"
viewBox="0 0 23 23"
fill="none"
stroke="gray"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M22 12s-4-6-10-6S2 12 2 12s4 6 10 6 10-6 10-6zM12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path>
</svg>
</Box>
</Box>
</Box>
<Box
Expand All @@ -112,4 +141,4 @@ export default function LoginForm() {
</GenericModal>
</>
) : null;
}
}