From 507c972ecafeceaf4f8962ad881f8fb50c9b86c1 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 4 Oct 2025 17:37:22 -0700 Subject: paste art --- src/App.tsx | 14 +++-- src/main.tsx | 3 ++ src/pages/ChooseArt.tsx | 45 ++++++++++++++++ src/pages/Paint.tsx | 11 ++++ src/styles/colors.css | 119 ++++++++++++++++++++++++++++++++++++++++ src/styles/styles.css | 140 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 329 insertions(+), 3 deletions(-) create mode 100644 src/pages/ChooseArt.tsx create mode 100644 src/pages/Paint.tsx create mode 100644 src/styles/colors.css create mode 100644 src/styles/styles.css (limited to 'src') diff --git a/src/App.tsx b/src/App.tsx index 8666e34..3623384 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,13 @@ +import { useState } from "react"; +import { ChooseArt } from "./pages/ChooseArt"; +import { Paint } from "./pages/Paint"; + export const App: React.FC = () => { - return
- hello -
+ const [chosenArt, setChosenArt] = useState(undefined); + + if (chosenArt === undefined) { + return + } + + return } diff --git a/src/main.tsx b/src/main.tsx index 65bf1da..32ff2d4 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,6 +1,9 @@ import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; +import '@/styles/colors.css'; +import '@/styles/styles.css'; + import { App } from '@/App'; createRoot(document.getElementById('root')!).render( diff --git a/src/pages/ChooseArt.tsx b/src/pages/ChooseArt.tsx new file mode 100644 index 0000000..fab6d79 --- /dev/null +++ b/src/pages/ChooseArt.tsx @@ -0,0 +1,45 @@ +import type React from 'react'; +import { useEffect, useRef, useState } from 'react'; + +export interface ChooseArtProps { + artSubmissionCallback: (art: string) => void; +} + +export const ChooseArt: React.FC = ({ + artSubmissionCallback, +}) => { + const [art, setArt] = useState(''); + const promptRef = useRef(null); + + useEffect(() => { + if (!promptRef.current) { + return; + } + // Automatically focus the textarea when the component mounts + promptRef.current.focus(); + }, [promptRef]); + + const handleSubmit = () => { + if (!art.trim()) { + return; + } + artSubmissionCallback(art); + }; + + return ( +
+