@@ -5,9 +5,11 @@ import { Controller, SubmitHandler, useForm } from 'react-hook-form';
5
5
import { Key } from 'ts-key-enum' ;
6
6
import { z } from 'zod' ;
7
7
8
+ import { Logo } from '@/auth/components/Logo' ;
8
9
import { SubTitle } from '@/auth/components/SubTitle' ;
9
10
import { Title } from '@/auth/components/Title' ;
10
11
import { useAuth } from '@/auth/hooks/useAuth' ;
12
+ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState' ;
11
13
import { useRefreshObjectMetadataItems } from '@/object-metadata/hooks/useRefreshObjectMetadataItem' ;
12
14
import { useSetNextOnboardingStatus } from '@/onboarding/hooks/useSetNextOnboardingStatus' ;
13
15
import { WorkspaceLogoUploader } from '@/settings/workspace/components/WorkspaceLogoUploader' ;
@@ -16,7 +18,9 @@ import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
16
18
import { TextInputV2 } from '@/ui/input/components/TextInputV2' ;
17
19
import { Modal } from '@/ui/layout/modal/components/Modal' ;
18
20
import { Trans , useLingui } from '@lingui/react/macro' ;
21
+ import { isNonEmptyString } from '@sniptt/guards' ;
19
22
import { motion } from 'framer-motion' ;
23
+ import { useRecoilValue } from 'recoil' ;
20
24
import { isDefined } from 'twenty-shared/utils' ;
21
25
import { H2Title } from 'twenty-ui/display' ;
22
26
import { Loader } from 'twenty-ui/feedback' ;
@@ -36,6 +40,15 @@ const StyledButtonContainer = styled.div`
36
40
width: 200px;
37
41
` ;
38
42
43
+ const StyledLoaderContainer = styled . div `
44
+ align-items: center;
45
+ display: flex;
46
+ justify-content: center;
47
+ margin-top: ${ ( { theme } ) => theme . spacing ( 8 ) } ;
48
+ width: 100%;
49
+ margin-bottom: ${ ( { theme } ) => theme . spacing ( 8 ) } ;
50
+ ` ;
51
+
39
52
enum PendingCreationLoaderStep {
40
53
None = 'none' ,
41
54
Step1 = 'step-1' ,
@@ -44,7 +57,6 @@ enum PendingCreationLoaderStep {
44
57
}
45
58
46
59
const StyledPendingCreationLoader = styled ( motion . div ) `
47
- height: 388px;
48
60
width: 100%;
49
61
display: flex;
50
62
justify-content: center;
@@ -62,6 +74,7 @@ export const CreateWorkspace = () => {
62
74
const [ pendingCreationLoaderStep , setPendingCreationLoaderStep ] = useState (
63
75
PendingCreationLoaderStep . None ,
64
76
) ;
77
+ const currentWorkspace = useRecoilValue ( currentWorkspaceState ) ;
65
78
66
79
const validationSchema = z
67
80
. object ( {
@@ -140,26 +153,36 @@ export const CreateWorkspace = () => {
140
153
< Modal . Content isVerticalCentered isHorizontalCentered >
141
154
{ pendingCreationLoaderStep !== PendingCreationLoaderStep . None && (
142
155
< >
156
+ < Logo
157
+ primaryLogo = {
158
+ isNonEmptyString ( currentWorkspace ?. logo )
159
+ ? currentWorkspace ?. logo
160
+ : undefined
161
+ }
162
+ />
163
+ < Title >
164
+ < Trans > Creating your workspace</ Trans >
165
+ </ Title >
143
166
< StyledPendingCreationLoader >
144
167
{ pendingCreationLoaderStep === PendingCreationLoaderStep . Step1 && (
145
- < Title animate >
146
- < Loader color = "gray" />
147
- < Trans > Setting up your database</ Trans >
148
- </ Title >
168
+ < SubTitle >
169
+ < Trans > Setting up your database...</ Trans >
170
+ </ SubTitle >
149
171
) }
150
172
{ pendingCreationLoaderStep === PendingCreationLoaderStep . Step2 && (
151
- < Title animate >
152
- < Loader color = "gray" />
153
- < Trans > Creating your schema</ Trans >
154
- </ Title >
173
+ < SubTitle >
174
+ < Trans > Creating your data model...</ Trans >
175
+ </ SubTitle >
155
176
) }
156
177
{ pendingCreationLoaderStep === PendingCreationLoaderStep . Step3 && (
157
- < Title animate >
158
- < Loader color = "gray" />
159
- < Trans > Prefilling your workspace data</ Trans >
160
- </ Title >
178
+ < SubTitle >
179
+ < Trans > Prefilling your workspace data...</ Trans >
180
+ </ SubTitle >
161
181
) }
162
182
</ StyledPendingCreationLoader >
183
+ < StyledLoaderContainer >
184
+ < Loader color = "gray" />
185
+ </ StyledLoaderContainer >
163
186
</ >
164
187
) }
165
188
{ pendingCreationLoaderStep === PendingCreationLoaderStep . None && (
0 commit comments