react-icons/fa#FaLock JavaScript Examples

The following examples show how to use react-icons/fa#FaLock. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MsgFlagModal.js    From airdnd-frontend with MIT License 5 votes vote down vote up
StFaLock = styled(FaLock)`
  font-size: 1.4rem;
`
Example #2
Source File: index.js    From FinDevs with MIT License 5 votes vote down vote up
export default function SignInForm({ history }) {
  const [gitUser, setGitUser] = useState('');
  const [password, setPassword] = useState('');

  async function handleSubmit(e) {
    e.preventDefault();

    try {
      const response = await api.post('/login', {
        github_user: gitUser,
        password,
      });
      const { token } = response.data;

      localStorage.setItem('findevs-token', token);

      history.push('/app');
    } catch (err) {
      const { error: loginError } = err.response.data;


      await Swal.fire({
        title: `${loginError}`,
        icon: 'error',
        confirmButtonColor: '#7159c1',
      });
    }
  }

  return (
    <Form onSubmit={handleSubmit}>
      <img src={logo} alt="FinDevs" />
      <Title>Sign in</Title>
      <InputGroup>
        <FaGithubAlt className="icon" />
        <Input
          placeholder="GitHub User"
          name="gitUser"
          value={gitUser}
          required
          onChange={(e) => setGitUser(e.target.value)}
        />
      </InputGroup>
      <InputGroup>
        <FaLock className="icon" />
        <Input
          type="password"
          placeholder="Password"
          name="pass"
          required
          value={password}
          onChange={(e) => setPassword(e.target.value)}
        />
      </InputGroup>
      <Button type="submit">SIGN IN</Button>
    </Form>
  );
}