@@ -13,13 +13,16 @@ import {
13
13
IconMail ,
14
14
IconRocket ,
15
15
IconSettings ,
16
+ IconTool ,
16
17
IconUserCircle ,
17
18
IconUsers ,
19
+ MAIN_COLORS ,
18
20
} from 'twenty-ui' ;
19
21
20
22
import { useAuth } from '@/auth/hooks/useAuth' ;
21
23
import { billingState } from '@/client-config/states/billingState' ;
22
24
import { SettingsNavigationDrawerItem } from '@/settings/components/SettingsNavigationDrawerItem' ;
25
+ import { useExpandedHeightAnimation } from '@/settings/hooks/useExpandedHeightAnimation' ;
23
26
import { getSettingsPagePath } from '@/settings/utils/getSettingsPagePath' ;
24
27
import { SettingsPath } from '@/types/SettingsPath' ;
25
28
import {
@@ -29,10 +32,38 @@ import {
29
32
import { NavigationDrawerItemGroup } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItemGroup' ;
30
33
import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection' ;
31
34
import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle' ;
35
+ import { isAdvancedModeEnabledState } from '@/ui/navigation/navigation-drawer/states/isAdvancedModeEnabledState' ;
32
36
import { getNavigationSubItemState } from '@/ui/navigation/navigation-drawer/utils/getNavigationSubItemState' ;
33
37
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled' ;
38
+ import styled from '@emotion/styled' ;
39
+ import { AnimatePresence , motion } from 'framer-motion' ;
34
40
import { matchPath , resolvePath , useLocation } from 'react-router-dom' ;
35
41
42
+ const StyledNavigationDrawerSection = styled ( NavigationDrawerSection ) < {
43
+ withLeftMargin ?: boolean ;
44
+ } > `
45
+ margin-left: ${ ( { withLeftMargin, theme } ) =>
46
+ withLeftMargin && theme . spacing ( 5 ) } ;
47
+ margin-top: ${ ( { theme } ) => theme . spacing ( 3 ) } ;
48
+ ` ;
49
+
50
+ const StyledIconContainer = styled . div `
51
+ border-right: 1px solid ${ MAIN_COLORS . yellow } ;
52
+ display: flex;
53
+ margin-top: ${ ( { theme } ) => theme . spacing ( 5 ) } ;
54
+ width: 16px;
55
+ ` ;
56
+
57
+ const StyledDeveloperSection = styled . div `
58
+ display: flex;
59
+ width: 100%;
60
+ gap: ${ ( { theme } ) => theme . spacing ( 1 ) } ;
61
+ ` ;
62
+
63
+ const StyledIconTool = styled ( IconTool ) `
64
+ margin-right: ${ ( { theme } ) => theme . spacing ( 0.5 ) } ;
65
+ ` ;
66
+
36
67
type SettingsNavigationItem = {
37
68
label : string ;
38
69
path : SettingsPath ;
@@ -42,6 +73,10 @@ type SettingsNavigationItem = {
42
73
} ;
43
74
44
75
export const SettingsNavigationDrawerItems = ( ) => {
76
+ const isAdvancedModeEnabled = useRecoilValue ( isAdvancedModeEnabledState ) ;
77
+ const { contentRef, motionAnimationVariants } = useExpandedHeightAnimation (
78
+ isAdvancedModeEnabled ,
79
+ ) ;
45
80
const { signOut } = useAuth ( ) ;
46
81
47
82
const billing = useRecoilValue ( billingState ) ;
@@ -88,7 +123,7 @@ export const SettingsNavigationDrawerItems = () => {
88
123
89
124
return (
90
125
< >
91
- < NavigationDrawerSection >
126
+ < StyledNavigationDrawerSection withLeftMargin >
92
127
< NavigationDrawerSectionTitle label = "User" />
93
128
< SettingsNavigationDrawerItem
94
129
label = "Profile"
@@ -121,8 +156,8 @@ export const SettingsNavigationDrawerItems = () => {
121
156
/>
122
157
) ) }
123
158
</ NavigationDrawerItemGroup >
124
- </ NavigationDrawerSection >
125
- < NavigationDrawerSection >
159
+ </ StyledNavigationDrawerSection >
160
+ < StyledNavigationDrawerSection withLeftMargin >
126
161
< NavigationDrawerSectionTitle label = "Workspace" />
127
162
< SettingsNavigationDrawerItem
128
163
label = "General"
@@ -147,18 +182,6 @@ export const SettingsNavigationDrawerItems = () => {
147
182
Icon = { IconHierarchy2 }
148
183
matchSubPages
149
184
/>
150
- < SettingsNavigationDrawerItem
151
- label = "Developers"
152
- path = { SettingsPath . Developers }
153
- Icon = { IconCode }
154
- />
155
- { isFunctionSettingsEnabled && (
156
- < SettingsNavigationDrawerItem
157
- label = "Functions"
158
- path = { SettingsPath . ServerlessFunctions }
159
- Icon = { IconFunction }
160
- />
161
- ) }
162
185
< SettingsNavigationDrawerItem
163
186
label = "Integrations"
164
187
path = { SettingsPath . Integrations }
@@ -171,8 +194,40 @@ export const SettingsNavigationDrawerItems = () => {
171
194
Icon = { IconCode }
172
195
/>
173
196
) }
174
- </ NavigationDrawerSection >
175
- < NavigationDrawerSection >
197
+ </ StyledNavigationDrawerSection >
198
+ < AnimatePresence >
199
+ { isAdvancedModeEnabled && (
200
+ < motion . div
201
+ ref = { contentRef }
202
+ initial = "initial"
203
+ animate = "animate"
204
+ exit = "exit"
205
+ variants = { motionAnimationVariants }
206
+ >
207
+ < StyledDeveloperSection >
208
+ < StyledIconContainer >
209
+ < StyledIconTool size = { 12 } color = { MAIN_COLORS . yellow } />
210
+ </ StyledIconContainer >
211
+ < StyledNavigationDrawerSection >
212
+ < NavigationDrawerSectionTitle label = "Developers" />
213
+ < SettingsNavigationDrawerItem
214
+ label = "API & Webhooks"
215
+ path = { SettingsPath . Developers }
216
+ Icon = { IconCode }
217
+ />
218
+ { isFunctionSettingsEnabled && (
219
+ < SettingsNavigationDrawerItem
220
+ label = "Functions"
221
+ path = { SettingsPath . ServerlessFunctions }
222
+ Icon = { IconFunction }
223
+ />
224
+ ) }
225
+ </ StyledNavigationDrawerSection >
226
+ </ StyledDeveloperSection >
227
+ </ motion . div >
228
+ ) }
229
+ </ AnimatePresence >
230
+ < StyledNavigationDrawerSection withLeftMargin >
176
231
< NavigationDrawerSectionTitle label = "Other" />
177
232
< SettingsNavigationDrawerItem
178
233
label = "Releases"
@@ -184,7 +239,7 @@ export const SettingsNavigationDrawerItems = () => {
184
239
onClick = { signOut }
185
240
Icon = { IconDoorEnter }
186
241
/>
187
- </ NavigationDrawerSection >
242
+ </ StyledNavigationDrawerSection >
188
243
</ >
189
244
) ;
190
245
} ;
0 commit comments