componentizing promptPanel

This commit is contained in:
Seth Forsgren 2022-11-23 21:47:18 -08:00
parent 54bc013531
commit f3f9447b56
4 changed files with 58 additions and 32 deletions

View File

@ -0,0 +1,17 @@
import { NextComponentType } from 'next'
interface PromptEntryProps {
prompt: string
}
const PromptEntry = (props: PromptEntryProps) => {
return (
<>
<p className="pb-32 text-lg text-gray-400">
{props.prompt}
</p>
</>
)
}
export default PromptEntry

View File

@ -0,0 +1,33 @@
import { NextComponentType } from 'next'
import PromptEntry from './PromptEntry'
const PromptPanel: NextComponentType = () => {
return (
<>
<main className="w-2/3 min-h-screen p-4">
<div className="pl-20 pt-10">
<PromptEntry prompt={"yo"}/>
<p className="pb-32 text-xl text-gray-300">
Taylor Swift singing with a tropical beat
</p>
<p className="pb-32 text-3xl text-white">Justin Bieber Anger Rap</p>
<p className="pb-32 text-m text-gray-400">
new york city rap, with a dust storm, cinematic score, dramatic,
composition, tons of energy, brutalistic
</p>
</div>
</main>
<input
className="fixed z-90 bottom-20 right-40 w-1/2 h-12 pl-3 text-xl text-black"
type="text"
id="prompt"
name="prompt"
placeholder="What do you want to hear?"
/>
</>
)
}
export default PromptPanel

View File

@ -10,13 +10,13 @@ const Modal: NextComponentType = () => {
return ( return (
<> <>
<button <button
title="Settings" title="Settings"
className="fixed z-90 top-8 right-8 bg-slate-100 w-14 h-14 rounded-full drop-shadow-lg className="fixed z-90 top-8 right-8 bg-slate-100 w-14 h-14 rounded-full drop-shadow-lg
flex justify-center items-center text-black text-2xl hover:bg-sky-500 hover:drop-shadow-2xl" flex justify-center items-center text-black text-2xl hover:bg-sky-500 hover:drop-shadow-2xl"
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
> >
<FiSliders /> <FiSliders />
</button> </button>
<Transition appear show={open} as={Fragment}> <Transition appear show={open} as={Fragment}>
<Dialog <Dialog

View File

@ -1,7 +1,7 @@
import Head from "next/head"; import Head from "next/head";
import ThreeCanvas from "../components/ThreeCanvas"; import ThreeCanvas from "../components/ThreeCanvas";
import { FiPause } from "react-icons/fi"; import PromptPanel from "../components/PromptPanel";
import Settings from '../components/Settings' import Settings from '../components/Settings'
import Pause from '../components/Pause' import Pause from '../components/Pause'
@ -22,34 +22,10 @@ export default function Home() {
<ThreeCanvas /> <ThreeCanvas />
</div> </div>
<main className="w-2/3 min-h-screen p-4"> <PromptPanel />
<div className="pl-20 pt-10">
<p className="pb-32 text-lg text-gray-400">
A jazz pianist playing a classical concerto
</p>
<p className="pb-32 text-xl text-gray-300">
Taylor Swift singing with a tropical beat
</p>
<p className="pb-32 text-3xl text-white">Justin Bieber Anger Rap</p>
<p className="pb-32 text-m text-gray-400">
new york city rap, with a dust storm, cinematic score, dramatic,
composition, tons of energy, brutalistic
</p>
</div>
</main>
{/* TODO(hayk): Convert into components. */}
<Settings /> <Settings />
<Pause /> <Pause />
<input
className="fixed z-90 bottom-20 right-40 w-1/2 h-12 pl-3 text-xl text-black"
type="text"
id="prompt"
name="prompt"
placeholder="What do you want to hear?"
/>
</div> </div>
</> </>
); );