Skip to content

Commit 306bd3c

Browse files
committed
refactor: remove unused SWITCH_VARIANTS and SWITCH_SHAPES constants from Switch component
1 parent b8f14c0 commit 306bd3c

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/Shared/Components/Switch/constants.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@ import { IconBaseColorType } from '@Shared/types'
33

44
import { DTSwitchProps } from './types'
55

6-
export const SWITCH_VARIANTS: Readonly<Record<DTSwitchProps['variant'], null>> = {
7-
theme: null,
8-
positive: null,
9-
}
10-
11-
export const SWITCH_SHAPES: Readonly<Record<DTSwitchProps['shape'], null>> = {
12-
rounded: null,
13-
square: null,
14-
}
15-
166
export const ROUNDED_SWITCH_SIZE_MAP: Readonly<Record<DTSwitchProps['size'], string>> = {
177
[ComponentSizeType.medium]: 'w-32',
188
[ComponentSizeType.small]: 'w-24',
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export { SWITCH_SHAPES, SWITCH_VARIANTS } from './constants'
21
export { default as DTSwitch } from './Switch.component'
32
export type { DTSwitchProps } from './types'

src/Shared/Components/Switch/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export type DTSwitchProps = {
9292
*/
9393
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.small>
9494

95+
/**
96+
* Callback function that is called when the switch state changes.
97+
* This function should handle the logic for toggling the switch.
98+
*/
9599
onChange: () => void
96100

97101
/**

0 commit comments

Comments
 (0)