@@ -4,7 +4,7 @@ import { ConfigItem, Radius, Margin, Padding, GridColumns, BorderWidth, BorderSt
4
4
import { isValidColor , isValidGradient , toHex } from "components/colorSelect/colorUtils" ;
5
5
import { ColorSelect } from "components/colorSelect" ;
6
6
import { TacoInput } from "components/tacoInput" ;
7
- import { Slider , Switch } from "antd" ;
7
+ import { Segmented , Slider , Switch } from "antd" ;
8
8
import {
9
9
ExpandIcon ,
10
10
CompressIcon ,
@@ -28,6 +28,7 @@ export type configChangeParams = {
28
28
components ?: Record < string , object > ,
29
29
showComponentLoadingIndicators ?: boolean ;
30
30
showDataLoadingIndicators ?: boolean ;
31
+ dataLoadingIndicator ?: string ;
31
32
gridColumns ?: string ;
32
33
gridRowHeight ?: string ;
33
34
gridRowCount ?: number ;
@@ -58,6 +59,7 @@ type ColorConfigProps = {
58
59
padding ?: string ;
59
60
showComponentLoadingIndicators ?: boolean ;
60
61
showDataLoadingIndicators ?: boolean ;
62
+ dataLoadingIndicator ?: string ;
61
63
gridColumns ?: string ;
62
64
gridRowHeight ?: string ;
63
65
gridRowCount ?: number ;
@@ -87,6 +89,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
87
89
fontFamily : defaultFontFamily ,
88
90
showComponentLoadingIndicators : defaultShowComponentLoaders ,
89
91
showDataLoadingIndicators : defaultShowDataLoaders ,
92
+ dataLoadingIndicator : defaultDataLoadingIndicator ,
90
93
gridColumns : defaultGridColumns ,
91
94
gridRowHeight : defaultGridRowHeight ,
92
95
gridRowCount : defaultGridRowCount ,
@@ -110,6 +113,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
110
113
const [ fontFamily , setFontFamily ] = useState ( defaultFontFamily ) ;
111
114
const [ showComponentLoaders , setComponentLoaders ] = useState ( defaultShowComponentLoaders ) ;
112
115
const [ showDataLoaders , setDataLoaders ] = useState ( defaultShowDataLoaders ) ;
116
+ const [ dataLoadingIndicator , setDataLoadingIndicator ] = useState ( defaultDataLoadingIndicator ) ;
113
117
const [ gridColumns , setGridColumns ] = useState ( defaultGridColumns ) ;
114
118
const [ gridRowHeight , setGridRowHeight ] = useState ( defaultGridRowHeight ) ;
115
119
const [ gridRowCount , setGridRowCount ] = useState ( defaultGridRowCount ) ;
@@ -346,6 +350,10 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
346
350
setDataLoaders ( defaultShowDataLoaders ) ;
347
351
} , [ defaultShowDataLoaders ] ) ;
348
352
353
+ useEffect ( ( ) => {
354
+ setDataLoadingIndicator ( defaultDataLoadingIndicator ) ;
355
+ } , [ defaultDataLoadingIndicator ] ) ;
356
+
349
357
useEffect ( ( ) => {
350
358
setGridPaddingX ( defaultGridPaddingX ) ;
351
359
} , [ defaultGridPaddingX ] ) ;
@@ -375,6 +383,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
375
383
themeSettingKey !== "fontFamily" &&
376
384
themeSettingKey !== "showComponentLoadingIndicators" &&
377
385
themeSettingKey !== "showDataLoadingIndicators" &&
386
+ themeSettingKey !== "dataLoadingIndicator" &&
378
387
themeSettingKey !== "gridColumns" &&
379
388
themeSettingKey !== "gridRowHeight" &&
380
389
themeSettingKey !== "gridRowCount" &&
@@ -551,6 +560,25 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
551
560
</ div >
552
561
) }
553
562
563
+ { themeSettingKey === "dataLoadingIndicator" && (
564
+ < div style = { {
565
+ marginTop : '6px' ,
566
+ } } >
567
+ < Segmented
568
+ block
569
+ value = { dataLoadingIndicator }
570
+ options = { [
571
+ { value : 'spinner' , label : 'Spinner' } ,
572
+ { value : 'skeleton' , label : 'Skeleton' } ,
573
+ ] }
574
+ onChange = { ( value ) => {
575
+ setDataLoadingIndicator ( value )
576
+ configChange ( { themeSettingKey, dataLoadingIndicator : value } ) ;
577
+ } }
578
+ />
579
+ </ div >
580
+ ) }
581
+
554
582
{ themeSettingKey === "gridColumns" && (
555
583
< div className = "config-input" >
556
584
< GridColumns $gridColumns = { defaultGridColumns || "24" } >
0 commit comments