@@ -3,13 +3,8 @@ import { isApiValidationError } from "api/errors";
3
3
import type { CreateOrganizationRequest } from "api/typesGenerated" ;
4
4
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
5
5
import { Badges , PremiumBadge } from "components/Badges/Badges" ;
6
+ import { Button } from "components/Button/Button" ;
6
7
import { ChooseOne , Cond } from "components/Conditionals/ChooseOne" ;
7
- import {
8
- Form ,
9
- FormFields ,
10
- FormFooter ,
11
- FormSection ,
12
- } from "components/Form/Form" ;
13
8
import { IconField } fr
10000
om "components/IconField/IconField" ;
14
9
import { Paywall } from "components/Paywall/Paywall" ;
15
10
import { PopoverPaywall } from "components/Paywall/PopoverPaywall" ;
@@ -21,6 +16,7 @@ import {
21
16
import { useFormik } from "formik" ;
22
17
import { ArrowLeft } from "lucide-react" ;
23
18
import type { FC } from "react" ;
19
+ import { useNavigate } from "react-router-dom" ;
24
20
import { Link } from "react-router-dom" ;
25
21
import { docs } from "utils/docs" ;
26
22
import {
@@ -62,6 +58,7 @@ export const CreateOrganizationPageView: FC<
62
58
validationSchema,
63
59
onSubmit,
64
60
} ) ;
61
+ const navigate = useNavigate ( ) ;
65
62
const getFieldHelpers = getFormHelpers ( form , error ) ;
66
63
67
64
return (
@@ -75,7 +72,7 @@ export const CreateOrganizationPageView: FC<
75
72
Go Back
76
73
</ Link >
77
74
</ div >
78
- < div className = "flex flex-col gap-4 max-w-2xl mx-auto" >
75
+ < div className = "flex flex-col gap-4 w-4/5 max-w-xl min-w-72 mx-auto" >
79
76
< div className = "flex flex-col items-center" >
80
77
{ Boolean ( error ) && ! isApiValidationError ( error ) && (
81
78
< div css = { { marginBottom : 32 } } >
@@ -104,7 +101,7 @@ export const CreateOrganizationPageView: FC<
104
101
</ Badges >
105
102
106
103
< header className = "flex flex-col gap-2 items-center" >
107
- < h1 className = "text-3xl font-bold m-0" > New Organization</ h1 >
104
+ < h1 className = "text-3xl font-semibold m-0" > New Organization</ h1 >
108
105
< p className = "max-w-md text-sm text-content-secondary text-center" >
109
106
Organize your deployment into multiple platform teams with unique
110
107
provisioners, templates, groups, and members.
@@ -121,52 +118,55 @@ export const CreateOrganizationPageView: FC<
121
118
/>
122
119
</ Cond >
123
120
< Cond >
124
- < Form
125
- direction = "vertical"
121
+ < form
126
122
onSubmit = { form . handleSubmit }
127
123
aria-label = "Organization settings form"
124
+ className = "flex flex-col gap-6 w-full"
128
125
>
129
- < FormSection title = "" description = "" >
130
- < fieldset
131
- disabled = { form . isSubmitting }
132
- css = { {
133
- border : "unset" ,
134
- padding : 0 ,
135
- margin : 0 ,
136
- width : "100%" ,
137
- } }
126
+ < fieldset
127
+ disabled = { form . isSubmitting }
128
+ className = "flex flex-col gap-6 w-full border-none"
129
+ >
130
+ < TextField
131
+ { ...getFieldHelpers ( "name" ) }
132
+ onChange = { onChangeTrimmed ( form ) }
133
+ fullWidth
134
+ label = "Slug"
135
+ />
136
+ < TextField
137
+ { ...getFieldHelpers ( "display_name" ) }
138
+ fullWidth
139
+ label = "Display name"
140
+ />
141
+ < TextField
142
+ { ...getFieldHelpers ( "description" ) }
143
+ multiline
144
+ label = "Description"
145
+ rows = { 2 }
146
+ />
147
+ < IconField
148
+ { ...getFieldHelpers ( "icon" ) }
149
+ onChange = { onChangeTrimmed ( form ) }
150
+ onPickEmoji = { ( value ) => form . setFieldValue ( "icon" , value ) }
151
+ />
152
+ </ fieldset >
153
+ < div className = "flex flex-row gap-2" >
154
+ < Button
155
+ className = "w-20"
156
+
10000
type = "submit"
157
+ data-testid = "form-submit"
158
+ >
159
+ Save
160
+ </ Button >
161
+ < Button
162
+ variant = "outline"
163
+ type = "button"
164
+ onClick = { ( ) => navigate ( "/organizations" ) }
138
165
>
139
- < FormFields >
140
- < TextField
141
- { ...getFieldHelpers ( "name" ) }
142
- onChange = { onChangeTrimmed ( form ) }
143
- autoFocus
144
- fullWidth
145
- label = "Slug"
146
- />
147
- < TextField
148
- { ...getFieldHelpers ( "display_name" ) }
149
- fullWidth
150
- label = "Display name"
151
- />
152
- < TextField
153
- { ...getFieldHelpers ( "description" ) }
154
- multiline
155
- fullWidth
156
- label = "Description"
157
- rows = { 2 }
158
- />
159
- < IconField
160
- { ...getFieldHelpers ( "icon" ) }
161
- onChange = { onChangeTrimmed ( form ) }
162
- fullWidth
163
- onPickEmoji = { ( value ) => form . setFieldValue ( "icon" , value ) }
164
- />
165
- </ FormFields >
166
- </ fieldset >
167
- </ FormSection >
168
- < FormFooter isLoading = { form . isSubmitting } />
169
- </ Form >
166
+ Cancel
167
+ </ Button >
168
+ </ div >
169
+ </ form >
170
170
</ Cond >
171
171
</ ChooseOne >
172
172
</ div >
0 commit comments