+ Don't have an account?{' '} + +
+ > + ); +} diff --git a/app/components/auth/ClientAuth/SignUpForm.tsx b/app/components/auth/ClientAuth/SignUpForm.tsx new file mode 100644 index 00000000..2b853bd4 --- /dev/null +++ b/app/components/auth/ClientAuth/SignUpForm.tsx @@ -0,0 +1,137 @@ +import { useState } from 'react'; +import { toast } from 'react-toastify'; +import { getSupabase } from '~/lib/supabase/client'; +import type { AuthError } from '@supabase/supabase-js'; +import { GoogleIcon } from '~/components/icons/google-icon'; + +interface SignUpFormProps { + onToggleForm: () => void; +} + +export function SignUpForm({ onToggleForm }: SignUpFormProps) { + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [confirmPassword, setConfirmPassword] = useState(''); + const [isProcessing, setIsProcessing] = useState(false); + + const handleSignUp = async (e: React.FormEvent) => { + e.preventDefault(); + + if (password !== confirmPassword) { + toast.error('Passwords do not match'); + return; + } + + setIsProcessing(true); + + try { + const { error } = await getSupabase().auth.signUp({ email, password }); + + if (error) { + throw error; + } + + toast.success('Check your email for the confirmation link!'); + } catch (error) { + const authError = error as AuthError; + toast.error(authError.message || 'Failed to sign up'); + } finally { + setIsProcessing(false); + } + }; + + const handleGoogleSignIn = async () => { + const { error } = await getSupabase().auth.signInWithOAuth({ + provider: 'google', + }); + if (error) { + toast.error(error.message || 'Failed to sign in with Google'); + } + }; + + return ( + <> ++ Already have an account?{' '} + +
+ > + ); +} diff --git a/app/components/chat/ApproveChange.tsx b/app/components/chat/ApproveChange.tsx index 1bdc4bf2..6906b5c5 100644 --- a/app/components/chat/ApproveChange.tsx +++ b/app/components/chat/ApproveChange.tsx @@ -1,6 +1,6 @@ import React, { useRef, useState } from 'react'; import { classNames } from '~/utils/classNames'; -import { TEXTAREA_MIN_HEIGHT } from './BaseChat'; +import { TEXTAREA_MIN_HEIGHT } from './BaseChat/BaseChat'; export interface RejectChangeData { explanation: string; diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx deleted file mode 100644 index 299c7df1..00000000 --- a/app/components/chat/BaseChat.tsx +++ /dev/null @@ -1,497 +0,0 @@ -/* - * @ts-nocheck - * Preventing TS checks with files presented in the video for a better presentation. - */ -import React, { type RefCallback, useEffect, useState } from 'react'; -import { ClientOnly } from 'remix-utils/client-only'; -import { Menu } from '~/components/sidebar/Menu.client'; -import { IconButton } from '~/components/ui/IconButton'; -import { Workbench } from '~/components/workbench/Workbench.client'; -import { classNames } from '~/utils/classNames'; -import { Messages } from './Messages.client'; -import { type Message } from '~/lib/persistence/message'; -import { SendButton } from './SendButton.client'; -import * as Tooltip from '@radix-ui/react-tooltip'; - -import styles from './BaseChat.module.scss'; -import { ExamplePrompts } from '~/components/chat/ExamplePrompts'; -import { ExampleLibraryApps } from '~/components/app-library/ExampleLibraryApps'; - -import FilePreview from './FilePreview'; -import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition'; -import { ScreenshotStateManager } from './ScreenshotStateManager'; -import type { RejectChangeData } from './ApproveChange'; -import ApproveChange from './ApproveChange'; - -export const TEXTAREA_MIN_HEIGHT = 76; - -interface BaseChatProps { - textareaRef?: React.RefObject- Write, test, and fix your app all from one prompt -
-+ Write, test, and fix your app all from one prompt +
+