From f3f9447b56565c6f8f780328de209a6cfc96f81d Mon Sep 17 00:00:00 2001 From: Seth Forsgren Date: Wed, 23 Nov 2022 21:47:18 -0800 Subject: [PATCH] componentizing promptPanel --- components/PromptEntry.tsx | 17 +++++++++++++++++ components/PromptPanel.tsx | 33 +++++++++++++++++++++++++++++++++ components/Settings.tsx | 12 ++++++------ pages/index.tsx | 28 ++-------------------------- 4 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 components/PromptEntry.tsx create mode 100644 components/PromptPanel.tsx diff --git a/components/PromptEntry.tsx b/components/PromptEntry.tsx new file mode 100644 index 0000000..f6f5d92 --- /dev/null +++ b/components/PromptEntry.tsx @@ -0,0 +1,17 @@ +import { NextComponentType } from 'next' + +interface PromptEntryProps { + prompt: string +} + +const PromptEntry = (props: PromptEntryProps) => { + return ( + <> +

+ {props.prompt} +

+ + ) + } + + export default PromptEntry \ No newline at end of file diff --git a/components/PromptPanel.tsx b/components/PromptPanel.tsx new file mode 100644 index 0000000..71d0d24 --- /dev/null +++ b/components/PromptPanel.tsx @@ -0,0 +1,33 @@ +import { NextComponentType } from 'next' +import PromptEntry from './PromptEntry' + +const PromptPanel: NextComponentType = () => { + + return ( + <> +
+
+ +

+ Taylor Swift singing with a tropical beat +

+

Justin Bieber Anger Rap

+

+ new york city rap, with a dust storm, cinematic score, dramatic, + composition, tons of energy, brutalistic +

+
+
+ + + + ) +} + +export default PromptPanel diff --git a/components/Settings.tsx b/components/Settings.tsx index 567a81f..d001823 100644 --- a/components/Settings.tsx +++ b/components/Settings.tsx @@ -10,13 +10,13 @@ const Modal: NextComponentType = () => { return ( <> + onClick={() => setOpen(true)} + > + + -
-
-

- A jazz pianist playing a classical concerto -

-

- Taylor Swift singing with a tropical beat -

-

Justin Bieber Anger Rap

-

- new york city rap, with a dust storm, cinematic score, dramatic, - composition, tons of energy, brutalistic -

-
-
- - {/* TODO(hayk): Convert into components. */} + - - );