From 5b449f9b3b3bff648f001d19e0254ee70707dd74 Mon Sep 17 00:00:00 2001 From: Seth Forsgren Date: Thu, 24 Nov 2022 12:39:30 -0800 Subject: [PATCH] prop formatting --- components/PromptEntry.tsx | 12 +++++++----- components/PromptPanel.tsx | 29 +++++++++++++++++------------ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/components/PromptEntry.tsx b/components/PromptEntry.tsx index bdb80f3..93c934f 100644 --- a/components/PromptEntry.tsx +++ b/components/PromptEntry.tsx @@ -5,14 +5,16 @@ interface PromptEntryProps { className: string } -const PromptEntry = (props: PromptEntryProps) => { +export default function PromptEntry({ + prompt, + className, +}: PromptEntryProps) { + return ( <> -

- {props.prompt} +

+ {prompt}

) } - - export default PromptEntry \ No newline at end of file diff --git a/components/PromptPanel.tsx b/components/PromptPanel.tsx index c4a2d72..026adaf 100644 --- a/components/PromptPanel.tsx +++ b/components/PromptPanel.tsx @@ -1,22 +1,26 @@ import PromptEntry from './PromptEntry' import { PromptInput } from "../types"; + interface PromptPanelProps { prompts: PromptInput[]; addPrompt: (prompt: string) => void; } -const PromptPanel = (props: PromptPanelProps) => { - const prompts = props.prompts; - const addPrompt = props.addPrompt; +export default function PromptPanel({ + prompts, + addPrompt, +}: PromptPanelProps) { return ( <>
- {prompts.map((prompt, index) => ( - - ))} +
+ {prompts.map((prompt, index) => ( + + ))} +
{ e.preventDefault(); @@ -38,13 +42,14 @@ const PromptPanel = (props: PromptPanelProps) => { ) } -export default PromptPanel - // WIP manner of passing ideal font of each promptEntry based on where it is in the promptPanel. Could be done better with a map or something. // need not just order, but some context of where we are in time, and when that prompt will be primary (some global step state) const promptEntryClassNames = { - 0: "pb-32 text-lg text-gray-400", - 1: "pb-32 text-xl text-gray-300", - 2: "pb-32 text-3xl text-white", - 3: "pb-32 text-m text-gray-400", + 0: "pb-12 text-lg text-gray-400", + 1: "pb-1/6 text-xl text-gray-300", + 2: "pb-1/6 text-3xl text-white", + 3: "pb-1/6 text-m text-gray-400", + 4: "pb-1/6 text-m text-gray-300", + 5: "pb-1/6 text-m text-gray-400", + 6: "pb-1/6 text-m text-gray-300", }