text: import React, { useState } from 'react';
  import { Image } from 'react-native';
  import { useDispatch, useSelector } from 'react-redux';
  
  import Background from '~/components/Background';
  import logo from '~/assets/logoWhite.png';
  import { signInRequest } from '~/store/modules/auth/actions';
  
  import { Container, Form, FormInput, SubmitButton } from './styles';
  
  export default function SignIn() {
    const dispatch = useDispatch();
    const [id, setId] = useState('');
  
    const loading = useSelector(state => state.auth.loading);
  
    function handleSubmit() {
      dispatch(signInRequest(id));
    }
    return (
      <Background>
        <Container>
          <Image source={logo} />
          <Form>
            <FormInput
              icon="perm-identity"
              keyboardType="number-pad"
              autoCorrect={false}
              returnKeyType="send"
              onSubmitediting={handleSubmit}
              placeholder="Informe seu ID de cadastro"
              value={id}
              onChangeText={setId}
            />
  
            <SubmitButton loading={loading} onPress={handleSubmit}>
              Entrar no sistema
            </SubmitButton>
          </Form>
        </Container>
      </Background>
    );
  }
  