@@ -11,13 +11,12 @@ import {
1111 Text ,
1212 useDisclosure ,
1313} from '@chakra-ui/react' ;
14- import { createSelector , current } from '@reduxjs/toolkit' ;
14+ import { createSelector } from '@reduxjs/toolkit' ;
1515import { VALID_LOG_LEVELS } from 'app/logging/useLogger' ;
1616import { LOCALSTORAGE_KEYS , LOCALSTORAGE_PREFIX } from 'app/store/constants' ;
1717import { useAppDispatch , useAppSelector } from 'app/store/storeHooks' ;
1818import IAIButton from 'common/components/IAIButton' ;
1919import IAIMantineSelect from 'common/components/IAIMantineSelect' ;
20- import IAISwitch from 'common/components/IAISwitch' ;
2120import { systemSelector } from 'features/system/store/systemSelectors' ;
2221import {
2322 SystemState ,
@@ -48,8 +47,9 @@ import {
4847} from 'react' ;
4948import { useTranslation } from 'react-i18next' ;
5049import { LogLevelName } from 'roarr' ;
51- import SettingsSchedulers from './SettingsSchedulers ' ;
50+ import SettingSwitch from './SettingSwitch ' ;
5251import SettingsClearIntermediates from './SettingsClearIntermediates' ;
52+ import SettingsSchedulers from './SettingsSchedulers' ;
5353
5454const selector = createSelector (
5555 [ systemSelector , uiSelector ] ,
@@ -206,15 +206,15 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
206206 < Flex sx = { { gap : 4 , flexDirection : 'column' } } >
207207 < StyledFlex >
208208 < Heading size = "sm" > { t ( 'settings.general' ) } </ Heading >
209- < IAISwitch
209+ < SettingSwitch
210210 label = { t ( 'settings.confirmOnDelete' ) }
211211 isChecked = { shouldConfirmOnDelete }
212212 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
213213 dispatch ( setShouldConfirmOnDelete ( e . target . checked ) )
214214 }
215215 />
216216 { shouldShowAdvancedOptionsSettings && (
217- < IAISwitch
217+ < SettingSwitch
218218 label = { t ( 'settings.showAdvancedOptions' ) }
219219 isChecked = { shouldShowAdvancedOptions }
220220 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
@@ -231,37 +231,29 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
231231
232232 < StyledFlex >
233233 < Heading size = "sm" > { t ( 'settings.ui' ) } </ Heading >
234- < IAISwitch
234+ < SettingSwitch
235235 label = { t ( 'settings.displayHelpIcons' ) }
236236 isChecked = { shouldDisplayGuides }
237237 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
238238 dispatch ( setShouldDisplayGuides ( e . target . checked ) )
239239 }
240240 />
241- { shouldShowBetaLayout && (
242- < IAISwitch
243- label = { t ( 'settings.useCanvasBeta' ) }
244- isChecked = { shouldUseCanvasBetaLayout }
245- onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
246- dispatch ( setShouldUseCanvasBetaLayout ( e . target . checked ) )
247- }
248- />
249- ) }
250- < IAISwitch
241+
242+ < SettingSwitch
251243 label = { t ( 'settings.useSlidersForAll' ) }
252244 isChecked = { shouldUseSliders }
253245 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
254246 dispatch ( setShouldUseSliders ( e . target . checked ) )
255247 }
256248 />
257- < IAISwitch
249+ < SettingSwitch
258250 label = { t ( 'settings.showProgressInViewer' ) }
259251 isChecked = { shouldShowProgressInViewer }
260252 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
261253 dispatch ( setShouldShowProgressInViewer ( e . target . checked ) )
262254 }
263255 />
264- < IAISwitch
256+ < SettingSwitch
265257 label = { t ( 'settings.antialiasProgressImages' ) }
266258 isChecked = { shouldAntialiasProgressImage }
267259 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
@@ -270,9 +262,21 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
270262 )
271263 }
272264 />
265+ { shouldShowBetaLayout && (
266+ < SettingSwitch
267+ label = { t ( 'settings.alternateCanvasLayout' ) }
268+ useBadge
269+ badgeLabel = { t ( 'settings.beta' ) }
270+ isChecked = { shouldUseCanvasBetaLayout }
271+ onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
272+ dispatch ( setShouldUseCanvasBetaLayout ( e . target . checked ) )
273+ }
274+ />
275+ ) }
273276 { shouldShowNodesToggle && (
274- < IAISwitch
275- label = "Enable Nodes Editor (Experimental)"
277+ < SettingSwitch
278+ label = { t ( 'settings.enableNodesEditor' ) }
279+ useBadge
276280 isChecked = { isNodesEnabled }
277281 onChange = { handleToggleNodes }
278282 />
@@ -282,7 +286,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
282286 { shouldShowDeveloperSettings && (
283287 < StyledFlex >
284288 < Heading size = "sm" > { t ( 'settings.developer' ) } </ Heading >
285- < IAISwitch
289+ < SettingSwitch
286290 label = { t ( 'settings.shouldLogToConsole' ) }
287291 isChecked = { shouldLogToConsole }
288292 onChange = { handleLogToConsoleChanged }
@@ -294,7 +298,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
294298 value = { consoleLogLevel }
295299 data = { VALID_LOG_LEVELS . concat ( ) }
296300 />
297- < IAISwitch
301+ < SettingSwitch
298302 label = { t ( 'settings.enableImageDebugging' ) }
299303 isChecked = { enableImageDebugging }
300304 onChange = { ( e : ChangeEvent < HTMLInputElement > ) =>
0 commit comments