File tree 2 files changed +6
-1
lines changed
services/xdesign-story/src/components/Switch
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const SwitchContainer = styled.div<SwitchContainerProps>`
39
39
}
40
40
` ;
41
41
42
- export const Switch = ( { isOn, onClick, isActive } : SwitchProps ) => {
42
+ export const Switch = ( { isOn = false , onClick, isActive = false } : SwitchProps ) => {
43
43
return (
44
44
< SwitchContainer onClick = { isActive ? onClick : ( ) => { } } isActive = { isActive } >
45
45
< div className = { `wrapper ${ isOn ? 'switch--checked' : null } ` } />
Original file line number Diff line number Diff line change 1
1
import { HTMLAttributes } from 'react' ;
2
2
3
3
export interface SwitchProps extends HTMLAttributes < HTMLElement > {
4
+ /** on/off 여부*/
4
5
isOn : boolean ;
6
+
7
+ /** 클릭 이벤트 */
5
8
onClick : ( ) => void ;
9
+
10
+ /** 활성화/비활성화 여부 */
6
11
isActive : boolean ;
7
12
}
You can’t perform that action at this time.
0 commit comments