@@ -6,7 +6,6 @@ import { Margins } from "components/Margins/Margins"
6
6
import { Stack } from "components/Stack/Stack"
7
7
import React , { ElementType , PropsWithChildren , ReactNode } from "react"
8
8
import { NavLink } from "react-router-dom"
9
- import { MONOSPACE_FONT_FAMILY } from "theme/constants"
10
9
import { combineClasses } from "util/combineClasses"
11
10
12
11
const Sidebar : React . FC < PropsWithChildren > = ( { children } ) => {
@@ -48,24 +47,13 @@ const SidebarCaption: React.FC<PropsWithChildren> = ({ children }) => {
48
47
export const SettingsHeader : React . FC < {
49
48
title : string
50
49
description : string | JSX . Element
51
- isEnterprise ?: boolean
52
- isEnabled ?: boolean
53
50
docsHref : string
54
- } > = ( { title, description, isEnterprise , docsHref, isEnabled } ) => {
51
+ } > = ( { title, description, docsHref } ) => {
55
52
const styles = useStyles ( )
56
53
57
54
return (
58
55
< Stack alignItems = "baseline" direction = "row" justifyContent = "space-between" >
59
56
< div className = { styles . headingGroup } >
60
- < Stack direction = "row" alignItems = "center" className = { styles . badges } spacing = { 1 } >
61
- { isEnabled ? (
62
- < span className = { styles . enabledBadge } > Enabled</ span >
63
- ) : (
64
- < span className = { styles . disabledBadge } > Enabled</ span >
65
- ) }
66
- { isEnterprise ? < span className = { styles . enterpriseBadge } > Enterprise</ span > : null }
67
- </ Stack >
68
-
69
57
< h1 className = { styles . title } > { title } </ h1 >
70
58
< span className = { styles . description } > { description } </ span >
71
59
</ div >
@@ -84,60 +72,21 @@ export const SettingsHeader: React.FC<{
84
72
)
85
73
}
86
74
87
- export const SettingsList : React . FC < PropsWithChildren > = ( { children } ) => {
88
- const styles = useStyles ( )
89
-
90
- return < div className = { styles . settingsList } > { children } </ div >
91
- }
92
-
93
- const SettingsValue : React . FC < { label : string ; value : string ; type ?: "primary" | "secondary" } > = ( {
94
- label,
95
- value,
96
- type = "primary" ,
75
+ export const SettingsBadges : React . FC < { isEnterprise ?: boolean ; isEnabled ?: boolean } > = ( {
76
+ isEnterprise,
77
+ isEnabled,
97
78
} ) => {
98
79
const styles = useStyles ( )
99
80
100
81
return (
101
- < div >
102
- < span className = { styles . settingsValueLabel } > { label } </ span >
103
- < span
104
- className = { combineClasses ( [
105
- styles . settingsValueValue ,
106
- type === "secondary" ? styles . settingsValueSecondary : undefined ,
107
- ] ) }
108
- >
109
- { value }
110
- </ span >
111
- </ div >
112
- )
113
- }
114
-
115
- export const SettingsItem : React . FC < {
116
- title : string
117
- description : string | JSX . Element
118
- values : { label : string ; value : string } [ ]
119
- } > = ( { title, description, values } ) => {
120
- const styles = useStyles ( )
121
-
122
- return (
123
- < section className = { styles . settingsItem } >
124
- < div >
125
- < h2 className = { styles . settingsItemTitle } > { title } </ h2 >
126
- < span className = { styles . settingsItemDescription } > { description } </ span >
127
- </ div >
128
-
129
- < Stack alignItems = "baseline" direction = "row" className = { styles . settingsValues } spacing = { 5 } >
130
- { values . map ( ( { value, label } , index ) => (
131
- < SettingsValue
132
- key = { label }
133
- label = { label }
134
- value = { value }
135
- // The first value is primary and the other secondary
136
- type = { index === 0 ? "primary" : "secondary" }
137
- />
138
- ) ) }
139
- </ Stack >
140
- </ section >
82
+ < Stack direction = "row" alignItems = "center" className = { styles . badges } spacing = { 1 } >
83
+ { isEnabled ? (
84
+ < span className = { styles . enabledBadge } > Enabled</ span >
85
+ ) : (
86
+ < span className = { styles . disabledBadge } > Enabled</ span >
87
+ ) }
88
+ { isEnterprise ? < span className = { styles . enterpriseBadge } > Enterprise</ span > : null }
89
+ </ Stack >
141
90
)
142
91
}
143
92
@@ -235,7 +184,6 @@ const useStyles = makeStyles((theme) => ({
235
184
} ,
236
185
237
186
headingGroup : {
238
- marginBottom : theme . spacing ( 3 ) ,
239
187
maxWidth : 420 ,
240
188
} ,
241
189
@@ -256,7 +204,8 @@ const useStyles = makeStyles((theme) => ({
256
204
} ,
257
205
258
206
badges : {
259
- marginBottom : theme . spacing ( 2 ) ,
207
+ marginTop : theme . spacing ( 3 ) ,
208
+ marginBottom : theme . spacing ( 3 ) ,
260
209
} ,
261
210
262
211
enterpriseBadge : {
@@ -294,53 +243,4 @@ const useStyles = makeStyles((theme) => ({
294
243
border : `1px solid ${ theme . palette . divider } ` ,
295
244
lineHeight : "160%" ,
296
245
} ,
297
-
298
- settingsList : {
299
- background : theme . palette . background . paper ,
300
- borderRadius : theme . shape . borderRadius ,
301
- border : `1px solid ${ theme . palette . divider } ` ,
302
- } ,
303
-
304
- settingsItem : {
305
- padding : theme . spacing ( 4 , 5 ) ,
306
-
307
- "&:not(:last-child)" : {
308
- borderBottom : `1px solid ${ theme . palette . divider } ` ,
309
- } ,
310
- } ,
311
-
312
- settingsItemTitle : {
313
- fontSize : 20 ,
314
- fontWeight : 400 ,
315
- lineHeight : "initial" ,
316
- margin : 0 ,
317
- marginBottom : theme . spacing ( 0.5 ) ,
318
- } ,
319
-
320
- settingsItemDescription : {
321
- fontSize : 14 ,
322
- color : theme . palette . text . secondary ,
323
- } ,
324
-
325
- settingsValues : {
326
- marginTop : theme . spacing ( 3 ) ,
327
- } ,
328
-
329
- settingsValueLabel : {
330
- fontSize : 14 ,
331
- fontWeight : 600 ,
332
- color : theme . palette . text . secondary ,
333
- marginBottom : theme . spacing ( 0.5 ) ,
334
- display : "block" ,
335
- } ,
336
-
337
- settingsValueValue : {
338
- display : "block" ,
339
- fontSize : 16 ,
340
- } ,
341
-
342
- settingsValueSecondary : {
343
- fontFamily : MONOSPACE_FONT_FAMILY ,
344
- color : theme . palette . text . secondary ,
345
- } ,
346
246
} ) )
0 commit comments