Skip to content

Commit

Permalink
fix: conditionally render project creation button based on project state
Browse files Browse the repository at this point in the history
  • Loading branch information
kriptonian1 committed Dec 21, 2024
1 parent 4c4e96e commit 5a01926
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions apps/platform/src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ export default function Index(): JSX.Element {

<Dialog onOpenChange={setIsDialogOpen} open={isDialogOpen}>
<DialogTrigger>
<Button onClick={toggleDialog}>
{' '}
<AddSVG /> Create a new Project
</Button>
{isProjectEmpty ? null : (
<Button onClick={toggleDialog}>
{' '}
<AddSVG /> Create a new Project
</Button>
)}
</DialogTrigger>
<DialogContent className="h-[39.5rem] w-[28.625rem] rounded-[12px] border bg-[#1E1E1F] ">
<div className="flex h-[3.125rem] w-[25.625rem] flex-col items-start justify-center">
Expand Down Expand Up @@ -334,7 +336,9 @@ export default function Index(): JSX.Element {
<div>
Create a file and start setting up your environment and secret keys
</div>
<Button variant="secondary">Create project</Button>
<Button onClick={toggleDialog} variant="secondary">
Create project
</Button>
</div>
)}

Expand Down

0 comments on commit 5a01926

Please sign in to comment.