Correcoes

This commit is contained in:
Lucas Santana 2024-12-19 19:13:18 -03:00
parent b213483fb7
commit 5a1ebc1387
3 changed files with 21 additions and 6 deletions

View File

@ -84,7 +84,10 @@ export function App() {
</div> </div>
)} )}
{step === 'register' && ( {step === 'register' && (
<RegistrationForm onComplete={handleRegistrationComplete} /> <RegistrationForm
userType="school"
onComplete={handleRegistrationComplete}
/>
)} )}
{step === 'avatar' && user && ( {step === 'avatar' && user && (
<AvatarSelector user={user} onComplete={handleAvatarComplete} /> <AvatarSelector user={user} onComplete={handleAvatarComplete} />

View File

@ -2,11 +2,12 @@ import React, { useState } from 'react';
import { User } from '../types'; import { User } from '../types';
import { Heart, User2, Info } from 'lucide-react'; import { Heart, User2, Info } from 'lucide-react';
interface Props { type RegistrationFormProps = {
onComplete: (user: User) => void; userType: 'school' | 'teacher';
} onComplete: (userData: User) => void;
};
export function RegistrationForm({ onComplete }: Props) { export const RegistrationForm: React.FC<RegistrationFormProps> = ({ userType, onComplete }) => {
const [name, setName] = useState(''); const [name, setName] = useState('');
const [age, setAge] = useState(8); const [age, setAge] = useState(8);
const [gender, setGender] = useState<'boy' | 'girl' | 'other'>('other'); const [gender, setGender] = useState<'boy' | 'girl' | 'other'>('other');

View File

@ -26,3 +26,14 @@ export interface StoryPage {
text: string; text: string;
image: string; image: string;
} }
export type Class = {
id?: string;
school_id: string;
name: string;
grade: string;
year: number;
period?: 'morning' | 'afternoon' | 'evening';
created_at?: string;
updated_at?: string;
};