@@ -4,7 +4,7 @@ import { ConfigItem, Radius, Margin, Padding, GridColumns, BorderWidth, BorderSt
44import { isValidColor , isValidGradient , toHex } from "components/colorSelect/colorUtils" ;
55import { ColorSelect } from "components/colorSelect" ;
66import { TacoInput } from "components/tacoInput" ;
7- import { Slider , Switch } from "antd" ;
7+ import { Segmented , Slider , Switch } from "antd" ;
88import {
99 ExpandIcon ,
1010 CompressIcon ,
@@ -28,6 +28,7 @@ export type configChangeParams = {
2828 components ?: Record < string , object > ,
2929 showComponentLoadingIndicators ?: boolean ;
3030 showDataLoadingIndicators ?: boolean ;
31+ dataLoadingIndicator ?: string ;
3132 gridColumns ?: string ;
3233 gridRowHeight ?: string ;
3334 gridRowCount ?: number ;
@@ -58,6 +59,7 @@ type ColorConfigProps = {
5859 padding ?: string ;
5960 showComponentLoadingIndicators ?: boolean ;
6061 showDataLoadingIndicators ?: boolean ;
62+ dataLoadingIndicator ?: string ;
6163 gridColumns ?: string ;
6264 gridRowHeight ?: string ;
6365 gridRowCount ?: number ;
@@ -87,6 +89,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
8789 fontFamily : defaultFontFamily ,
8890 showComponentLoadingIndicators : defaultShowComponentLoaders ,
8991 showDataLoadingIndicators : defaultShowDataLoaders ,
92+ dataLoadingIndicator : defaultDataLoadingIndicator ,
9093 gridColumns : defaultGridColumns ,
9194 gridRowHeight : defaultGridRowHeight ,
9295 gridRowCount : defaultGridRowCount ,
@@ -110,6 +113,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
110113 const [ fontFamily , setFontFamily ] = useState ( defaultFontFamily ) ;
111114 const [ showComponentLoaders , setComponentLoaders ] = useState ( defaultShowComponentLoaders ) ;
112115 const [ showDataLoaders , setDataLoaders ] = useState ( defaultShowDataLoaders ) ;
116+ const [ dataLoadingIndicator , setDataLoadingIndicator ] = useState ( defaultDataLoadingIndicator ) ;
113117 const [ gridColumns , setGridColumns ] = useState ( defaultGridColumns ) ;
114118 const [ gridRowHeight , setGridRowHeight ] = useState ( defaultGridRowHeight ) ;
115119 const [ gridRowCount , setGridRowCount ] = useState ( defaultGridRowCount ) ;
@@ -346,6 +350,10 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
346350 setDataLoaders ( defaultShowDataLoaders ) ;
347351 } , [ defaultShowDataLoaders ] ) ;
348352
353+ useEffect ( ( ) => {
354+ setDataLoadingIndicator ( defaultDataLoadingIndicator ) ;
355+ } , [ defaultDataLoadingIndicator ] ) ;
356+
349357 useEffect ( ( ) => {
350358 setGridPaddingX ( defaultGridPaddingX ) ;
351359 } , [ defaultGridPaddingX ] ) ;
@@ -375,6 +383,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
375383 themeSettingKey !== "fontFamily" &&
376384 themeSettingKey !== "showComponentLoadingIndicators" &&
377385 themeSettingKey !== "showDataLoadingIndicators" &&
386+ themeSettingKey !== "dataLoadingIndicator" &&
378387 themeSettingKey !== "gridColumns" &&
379388 themeSettingKey !== "gridRowHeight" &&
380389 themeSettingKey !== "gridRowCount" &&
@@ -551,6 +560,25 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
551560 </ div >
552561 ) }
553562
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+
554582 { themeSettingKey === "gridColumns" && (
555583 < div className = "config-input" >
556584 < GridColumns $gridColumns = { defaultGridColumns || "24" } >
0 commit comments