@@ -7,7 +7,8 @@ import { Form, useActionData, useNavigation } from "@remix-run/react";
77import { redirect , typedjson , useTypedLoaderData } from "remix-typedjson" ;
88import invariant from "tiny-invariant" ;
99import { z } from "zod" ;
10- import { MainCenteredContainer } from "~/components/layout/AppLayout" ;
10+ import { BackgroundWrapper } from "~/components/BackgroundWrapper" ;
11+ import { AppContainer , MainCenteredContainer } from "~/components/layout/AppLayout" ;
1112import { Button , LinkButton } from "~/components/primitives/Buttons" ;
1213import { Callout } from "~/components/primitives/Callout" ;
1314import { Fieldset } from "~/components/primitives/Fieldset" ;
@@ -20,15 +21,14 @@ import { Label } from "~/components/primitives/Label";
2021import { ButtonSpinner } from "~/components/primitives/Spinner" ;
2122import { prisma } from "~/db.server" ;
2223import { featuresForRequest } from "~/features.server" ;
23- import { useFeatures } from "~/hooks/useFeatures" ;
2424import { redirectWithSuccessMessage } from "~/models/message.server" ;
2525import { createProject } from "~/models/project.server" ;
2626import { requireUserId } from "~/services/session.server" ;
2727import {
2828 OrganizationParamsSchema ,
2929 organizationPath ,
30- v3ProjectPath ,
3130 selectPlanPath ,
31+ v3ProjectPath ,
3232} from "~/utils/pathBuilder" ;
3333
3434export async function loader ( { params, request } : LoaderFunctionArgs ) {
@@ -138,57 +138,61 @@ export default function Page() {
138138 const isLoading = navigation . state === "submitting" || navigation . state === "loading" ;
139139
140140 return (
141- < MainCenteredContainer >
142- < div >
143- < FormTitle
144- LeadingIcon = { < FolderIcon className = "size-7 text-indigo-500" /> }
145- title = "Create a new project"
146- description = { `This will create a new project in your "${ organization . title } " organization.` }
147- />
148- < Form method = "post" { ...form . props } >
149- { message && (
150- < Callout variant = "success" className = "mb-4" >
151- { message }
152- </ Callout >
153- ) }
154- < Fieldset >
155- < InputGroup >
156- < Label htmlFor = { projectName . id } > Project name</ Label >
157- < Input
158- { ...conform . input ( projectName , { type : "text" } ) }
159- placeholder = "Your project name"
160- icon = { FolderIcon }
161- autoFocus
162- />
163- < FormError id = { projectName . errorId } > { projectName . error } </ FormError >
164- </ InputGroup >
165- { canCreateV3Projects ? (
166- < input { ...conform . input ( projectVersion , { type : "hidden" } ) } value = { "v3" } />
167- ) : (
168- < input { ...conform . input ( projectVersion , { type : "hidden" } ) } value = { "v2" } />
169- ) }
170- < FormButtons
171- confirmButton = {
172- < Button
173- type = "submit"
174- variant = { "primary/small" }
175- disabled = { isLoading }
176- TrailingIcon = { isLoading ? ButtonSpinner : undefined }
177- >
178- { isLoading ? "Creating…" : "Create" }
179- </ Button >
180- }
181- cancelButton = {
182- organization . projectsCount > 0 ? (
183- < LinkButton to = { organizationPath ( organization ) } variant = { "tertiary/small" } >
184- Cancel
185- </ LinkButton >
186- ) : undefined
187- }
141+ < AppContainer className = "bg-charcoal-900" >
142+ < BackgroundWrapper >
143+ < MainCenteredContainer className = "max-w-[26rem] rounded-lg border border-grid-bright bg-background-dimmed p-5 shadow-lg" >
144+ < div >
145+ < FormTitle
146+ LeadingIcon = { < FolderIcon className = "size-7 text-indigo-500" /> }
147+ title = "Create a new project"
148+ description = { `This will create a new project in your "${ organization . title } " organization.` }
188149 />
189- </ Fieldset >
190- </ Form >
191- </ div >
192- </ MainCenteredContainer >
150+ < Form method = "post" { ...form . props } >
151+ { message && (
152+ < Callout variant = "success" className = "mb-4" >
153+ { message }
154+ </ Callout >
155+ ) }
156+ < Fieldset >
157+ < InputGroup >
158+ < Label htmlFor = { projectName . id } > Project name</ Label >
159+ < Input
160+ { ...conform . input ( projectName , { type : "text" } ) }
161+ placeholder = "Your project name"
162+ icon = { FolderIcon }
163+ autoFocus
164+ />
165+ < FormError id = { projectName . errorId } > { projectName . error } </ FormError >
166+ </ InputGroup >
167+ { canCreateV3Projects ? (
168+ < input { ...conform . input ( projectVersion , { type : "hidden" } ) } value = { "v3" } />
169+ ) : (
170+ < input { ...conform . input ( projectVersion , { type : "hidden" } ) } value = { "v2" } />
171+ ) }
172+ < FormButtons
173+ confirmButton = {
174+ < Button
175+ type = "submit"
176+ variant = { "primary/small" }
177+ disabled = { isLoading }
178+ TrailingIcon = { isLoading ? ButtonSpinner : undefined }
179+ >
180+ { isLoading ? "Creating…" : "Create" }
181+ </ Button >
182+ }
183+ cancelButton = {
184+ organization . projectsCount > 0 ? (
185+ < LinkButton to = { organizationPath ( organization ) } variant = { "secondary/small" } >
186+ Cancel
187+ </ LinkButton >
188+ ) : undefined
189+ }
190+ />
191+ </ Fieldset >
192+ </ Form >
193+ </ div >
194+ </ MainCenteredContainer >
195+ </ BackgroundWrapper >
196+ </ AppContainer >
193197 ) ;
194198}
0 commit comments