Created
December 30, 2023 11:31
-
-
Save rahulmore01/111cf047393aa3ffe265ecb59815763c to your computer and use it in GitHub Desktop.
genui project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UiToggle from "@/components/UiToggle"; | |
import React, { useState } from "react"; | |
interface GenerateUiProps { | |
onToggleCode: (newToggleCodeValue: boolean) => void; | |
} | |
const GenerateUi: React.FC<GenerateUiProps> = ({ onToggleCode }) => { | |
const [isToggleCode, setIsToggleCode] = useState(true); | |
const handleToggleCode = (newToggleCodeValue: boolean) => { | |
setIsToggleCode(newToggleCodeValue); | |
}; | |
return ( | |
<section className="flex flex-col bg-primary_light_color bg-opacity-15 h-full w-full rounded-lg"> | |
{/* generate ui options */} | |
<div className="flex justify-between items-center p-3"> | |
<div className="flex justify-start items-center gap-2"> | |
<div className="h-9 w-9 bg-white rounded-full border border-primary_color border-opacity-60"></div> | |
<h6>A luxury fashion brand landing page</h6> | |
</div> | |
<UiToggle onToggleCode={handleToggleCode} /> | |
</div> | |
{/* generate ui flip functionality */} | |
<div className="w-full h-full bg-secondary_color text-primary p-4"> | |
{isToggleCode ? <UiView /> : <CodeView />} | |
</div> | |
</section> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment