Skip to content

Commit

Permalink
Merge pull request #15 from ateliware/feature/increase-form-actions
Browse files Browse the repository at this point in the history
Feature:  Increase forms actions
  • Loading branch information
williamsimionatto authored May 9, 2024
2 parents 4966120 + 113fb65 commit f4ddc4a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 18 deletions.
39 changes: 30 additions & 9 deletions src/pages/RideOfferPage/RideOffer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function RideOfferPage() {
const {
register,
handleSubmit,
formState: { errors },
formState: { errors, isSubmitting },
} = useForm();
const { user, isLoadingRequest } = useAuthContext();

Check warning on line 14 in src/pages/RideOfferPage/RideOffer.tsx

View workflow job for this annotation

GitHub Actions / Lint

'isLoadingRequest' is assigned a value but never used
const navigate = useNavigate();
Expand Down Expand Up @@ -114,14 +114,35 @@ export default function RideOfferPage() {
error={!!errors.returnDate}
caption={errors.returnDate?.message as string}
/>
<Button
type="submit"
isLoading={isLoadingRequest}
className="!w-100 mb-s-100"
alignText="center"
>
Cadastrar
</Button>

<hr className="mt-s-400 w-100 bg-neutral-60" />

<div className="d-flex justify-between mt-s-400">
<div className="col-sm-5">
<Button
type="button"
className="!w-100 mb-s-100"
alignText="center"
size="small"
design="transparent"
onClick={() => navigate('/home')}
>
Cancelar
</Button>
</div>

<div className="col-sm-5">
<Button
type="submit"
isLoading={isSubmitting}
className="!w-100 mb-s-100"
alignText="center"
size="small"
>
Confirmar
</Button>
</div>
</div>
</form>
</div>
</div>
Expand Down
38 changes: 29 additions & 9 deletions src/pages/SignupPage/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function SignupPage() {
setError,
register,
handleSubmit,
formState: { errors },
formState: { errors, isSubmitting },
} = useForm();
const { login, user, isLoadingRequest } = useAuthContext();

Check warning on line 16 in src/pages/SignupPage/Signup.tsx

View workflow job for this annotation

GitHub Actions / Lint

'isLoadingRequest' is assigned a value but never used
const navigate = useNavigate();
Expand Down Expand Up @@ -137,14 +137,34 @@ export default function SignupPage() {
error={!!errors.city}
caption={errors.city?.message as string}
/>
<Button
type="submit"
isLoading={isLoadingRequest}
className="!w-100 mt-s-200"
alignText="center"
>
Cadastrar
</Button>
<hr className="mt-s-400 w-100 bg-neutral-60" />

<div className="d-flex justify-between mt-s-400">
<div className="col-sm-5">
<Button
type="button"
className="!w-100 mb-s-100"
alignText="center"
size="small"
design="transparent"
onClick={() => navigate('/home')}
>
Cancelar
</Button>
</div>

<div className="col-sm-5">
<Button
type="submit"
isLoading={isSubmitting}
className="!w-100 mb-s-100"
alignText="center"
size="small"
>
Confirmar
</Button>
</div>
</div>
</form>
</div>
</div>
Expand Down

0 comments on commit f4ddc4a

Please sign in to comment.