Skip to content

Commit

Permalink
Merge pull request #20 from ateliware/feature/register-service
Browse files Browse the repository at this point in the history
Feature/register service
  • Loading branch information
williamsimionatto authored May 10, 2024
2 parents 20b81e1 + 35bd21f commit dae8ca9
Show file tree
Hide file tree
Showing 10 changed files with 478 additions and 129 deletions.
1 change: 1 addition & 0 deletions src/interfaces/Cities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type City = {
name: string;
isActive: boolean;
state: State;
label?: string;
};

export type RemoteCity = {
Expand Down
28 changes: 28 additions & 0 deletions src/interfaces/Person.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export type Person = {
cpf: string;
password: string;
passwordConfirm: string;
name: string;
phoneNumber: string;
emergencyPhone: string;
emergencyContact: string;
birthDate: string;
avatar: string;
city: string;
lgpdAcceptance: boolean;
};

export type RemotePerson = {
cpf: string;
password?: string;
password_confirm?: string;
name: string;
phone: string;
emergency_phone: string;
emergency_contact: string;
birth_date: string;
avatar?: string;
city_id: number;
lgpd_acceptance?: boolean;
validation_uuid?: string;
};
26 changes: 17 additions & 9 deletions src/pages/RideOfferPage/RideOffer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { useEffect } from 'react';
import { FieldValues, SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';

import { Button, Input, Item, ItemList, PageHeader, Select } from '@components';
import {
Button,
Input,
InputTextArea,
Item,
ItemList,
PageHeader,
Select,
} from '@components';
import { useAuthContext } from '@contexts/AuthProvider';

export default function RideOfferPage() {
Expand All @@ -25,7 +33,7 @@ export default function RideOfferPage() {
meetingPoint: string;
carSpaces: number;
departureDate: Date;
returnDate: string;
notes: string;
}) => {
console.log('form submit');
}) as SubmitHandler<FieldValues>;
Expand Down Expand Up @@ -95,17 +103,17 @@ export default function RideOfferPage() {
className="mb-s-200"
form={register('departureDate', { required: 'Obrigatório' })}
label="Ida"
type="datetime-local"
type="date"
error={!!errors.departureDate}
caption={errors.departureDate?.message as string}
/>
<Input
<InputTextArea
className="mb-s-200"
form={register('returnDate', { required: 'Obrigatório' })}
label="Volta"
type="datetime-local"
error={!!errors.returnDate}
caption={errors.returnDate?.message as string}
form={register('notes', { required: 'Obrigatório' })}
label="Notas"
placeholder="Informações adicionais da viagem"
error={!!errors.notes}
caption={errors.notes?.message as string}
/>

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

0 comments on commit dae8ca9

Please sign in to comment.