Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(platform): Add new variables to a project #593

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions apps/platform/src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
DialogTrigger
} from '@/components/ui/dialog'
import ControllerInstance from '@/lib/controller-instance'
import { Textarea } from '@/components/ui/textarea'

export default function Index(): JSX.Element {
const [isSheetOpen, setIsSheetOpen] = useState<boolean>(false)
Expand Down Expand Up @@ -144,10 +145,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 @@ -190,8 +193,8 @@ export default function Index(): JSX.Element {
>
Description
</Label>
<Input
className="col-span-3 h-[5.625rem] w-[20rem] gap-[0.25rem]"
<Textarea
className="col-span-3 h-[5.625rem] w-[20rem] resize-none gap-[0.25rem]"
id="name"
onChange={(e) => {
setNewProjectData((prev) => ({
Expand All @@ -217,7 +220,10 @@ export default function Index(): JSX.Element {
onChange={(e) => {
setNewProjectData((prev) => ({
...prev,
envName: e.target.value
environments: (prev.environments || []).map(
(env, index) =>
index === 0 ? { ...env, name: e.target.value } : env
)
}))
}}
placeholder="Your project default environment name"
Expand All @@ -232,13 +238,18 @@ export default function Index(): JSX.Element {
>
Env. Description
</Label>
<Input
className="col-span-3 h-[4.875rem] w-[20rem] "
<Textarea
className="col-span-3 h-[4.875rem] w-[20rem] resize-none"
id="envDescription"
onChange={(e) => {
setNewProjectData((prev) => ({
...prev,
envDescription: e.target.value
environments: (prev.environments || []).map(
(env, index) =>
index === 0
? { ...env, description: e.target.value }
: env
)
}))
}}
placeholder="Detailed description about your environment"
Expand All @@ -265,7 +276,7 @@ export default function Index(): JSX.Element {
}))
}}
>
<SelectTrigger className=" h-[2.25rem] w-[20rem] rounded-[0.375rem] border-[0.013rem] border-white/10 focus:border-[#3b82f6]">
<SelectTrigger className=" h-[2.25rem] w-[20rem] rounded-[0.375rem] border-[0.013rem] border-white/10 bg-white/5 focus:border-[#3b82f6]">
<SelectValue />
</SelectTrigger>
<SelectContent className="border-[0.013rem] border-white/10 bg-neutral-800 text-white ">
Expand Down Expand Up @@ -334,7 +345,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
Loading
Loading