File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,15 @@ import theme from "../../theme";
9090 checked = { checked }
9191 readOnly
9292 />
93+ <Spacer height = " 1rem" />
94+ <Switch
95+ name = " label4"
96+ severity = " primary"
97+ labelText = " My Switch Button Notification"
98+ onClick = { toggle }
99+ checked = { checked }
100+ readOnly
101+ />
93102 </GnuiContainer >
94103 );
95104 }}
Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ import styled, { css } from "styled-components";
33import theme from "../../theme" ;
44import { setColor } from "../../utils/setcolor" ;
55
6- export type SwitchProps = {
6+ export type SwitchProps = React . ComponentPropsWithoutRef < "input" > & {
77 labelText ?: string ;
8- severity ?: "danger" | "notification" | "warning " | "success" ;
8+ severity ?: "danger" | "notification" | "primary " | "success" | "warning ";
99 position ?: "left" | "right" ;
10- } & React . ComponentPropsWithoutRef < "input" > ;
10+ } ;
1111
1212type SwitchInputProps = Pick < SwitchProps , "severity" > ;
1313
@@ -21,7 +21,9 @@ const SwitchInput = styled.input<SwitchInputProps>`
2121 ${ ( { severity } ) =>
2222 severity &&
2323 css `
24- background-color: ${ setColor ( severity ) } ;
24+ background-color: ${ severity === "primary"
25+ ? theme . color . interactive . primary
26+ : setColor ( severity ) } ;
2527 ` }
2628
2729 &:before {
You can’t perform that action at this time.
0 commit comments