improve sidebar visual style

This commit is contained in:
Abi Raja 2023-11-15 16:32:57 -05:00
parent 7ed13c5fd4
commit a126c37ed3
2 changed files with 50 additions and 12 deletions

View File

@ -8,6 +8,7 @@ import classNames from "classnames";
import { FaDownload, FaUndo } from "react-icons/fa"; import { FaDownload, FaUndo } from "react-icons/fa";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Textarea } from "@/components/ui/textarea"; import { Textarea } from "@/components/ui/textarea";
import { Separator } from "@/components/ui/separator";
function App() { function App() {
const [appState, setAppState] = useState<"INITIAL" | "CODING" | "CODE_READY">( const [appState, setAppState] = useState<"INITIAL" | "CODING" | "CODE_READY">(
@ -101,18 +102,24 @@ function App() {
<CodePreview code={generatedCode} /> <CodePreview code={generatedCode} />
</div> </div>
)} )}
<div className="flex gap-x-2"> <div className="flex gap-x-2 mt-2">
<div className="flex flex-col">
<div <div
className={classNames({ className={classNames({
"scanning relative": appState === "CODING", "scanning relative": appState === "CODING",
})} })}
> >
<img <img
className="w-[340px]" className="w-[340px] border border-gray-200 rounded-md"
src={referenceImages[0]} src={referenceImages[0]}
alt="Reference" alt="Reference"
/> />
</div> </div>
<div className="text-gray-400 uppercase text-sm text-center mt-1">
Original Screenshot
</div>
</div>
<div className="bg-gray-400 px-4 py-2 rounded text-sm hidden"> <div className="bg-gray-400 px-4 py-2 rounded text-sm hidden">
<h2 className="text-lg mb-4 border-b border-gray-800"> <h2 className="text-lg mb-4 border-b border-gray-800">
Console Console
@ -128,11 +135,13 @@ function App() {
</div> </div>
</div> </div>
<Separator className="mt-1 mb-2" />
{appState === "CODE_READY" && ( {appState === "CODE_READY" && (
<div> <div>
<div className="grid w-full gap-2"> <div className="grid w-full gap-2">
<Textarea <Textarea
placeholder="Describe what the AI missed the first time around" placeholder="Tell the AI what to change..."
onChange={(e) => setUpdateInstruction(e.target.value)} onChange={(e) => setUpdateInstruction(e.target.value)}
value={updateInstruction} value={updateInstruction}
/> />

View File

@ -0,0 +1,29 @@
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
import { cn } from "@/lib/utils"
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
{ className, orientation = "horizontal", decorative = true, ...props },
ref
) => (
<SeparatorPrimitive.Root
ref={ref}
decorative={decorative}
orientation={orientation}
className={cn(
"shrink-0 bg-border",
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
className
)}
{...props}
/>
)
)
Separator.displayName = SeparatorPrimitive.Root.displayName
export { Separator }