Skip to content

Commit 17fafe8

Browse files
committed
make styled-component props activeColour, inactiveColour and enabled props transient
1 parent afe7f4d commit 17fafe8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
+9-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import styled from 'styled-components';
22

33
export const StyledErrorButton = styled.button<{
4-
activeColour: string;
5-
inactiveColour: string;
4+
$activeColour: string;
5+
$inactiveColour: string;
66
fontFamily: string;
77
fontSize: number;
88
fontWeight: string;
99
fontStyle: string;
1010
color: string;
11-
enabled: boolean;
11+
$enabled: boolean;
1212
margin?: string;
1313
}>`
1414
align-self: flex-end;
15-
background-color: ${({inactiveColour, activeColour, enabled }) => (enabled ? activeColour : inactiveColour)};
16-
border: 2px solid ${({enabled, activeColour, inactiveColour}) => (enabled ? activeColour : inactiveColour)};
15+
background-color: ${({$inactiveColour, $activeColour, $enabled }) => ($enabled ? $activeColour : $inactiveColour)};
16+
border: 2px solid ${({$enabled, $activeColour, $inactiveColour}) => ($enabled ? $activeColour : $inactiveColour)};
1717
font-family: Arial;
1818
font-size: 14px;
1919
min-height: 30px;
@@ -23,12 +23,12 @@ export const StyledErrorButton = styled.button<{
2323
font-style: ${({ fontStyle }) => fontStyle};
2424
color: ${({ color }) => color};
2525
&:hover {
26-
background-color: ${({enabled, activeColour, inactiveColour}) => (enabled ? activeColour : inactiveColour)};
26+
background-color: ${({$enabled, $activeColour, $inactiveColour}) => ($enabled ? $activeColour : $inactiveColour)};
2727
color: ${({ color }) => color};
28-
border: 2px solid ${({enabled, inactiveColour, activeColour}) => (enabled ? activeColour : inactiveColour)};
29-
outline: ${({enabled, activeColour}) => (enabled ? activeColour : 'transparent')} solid 2px;
28+
border: 2px solid ${({$enabled, $inactiveColour, $activeColour}) => ($enabled ? $activeColour : $inactiveColour)};
29+
outline: ${({$enabled, $activeColour}) => ($enabled ? $activeColour : 'transparent')} solid 2px;
3030
}
3131
&:focus {
32-
outline: ${(props) => (props.enabled ? props.activeColour : 'transparent')} solid 2px;
32+
outline: ${(props) => (props.$enabled ? props.$activeColour : 'transparent')} solid 2px;
3333
}
3434
`;

0 commit comments

Comments
 (0)