Skip to content

Commit

Permalink
fix: Make the entire advanced mode toggle container clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
Vardhaman619 committed Oct 16, 2024
1 parent f827d52 commit fbaace5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const StyledText = styled.span`
font-size: ${({ theme }) => theme.font.size.sm};
font-weight: ${({ theme }) => theme.font.weight.medium};
padding: ${({ theme }) => theme.spacing(1)};
cursor: pointer;
flex-grow: 1;
`;

const StyledIconContainer = styled.div`
Expand Down Expand Up @@ -46,13 +48,17 @@ export const AdvancedSettingsToggle = () => {
setIsAdvancedModeEnabled(newValue);
};

const toogleAdvancedMode = () => {
setIsAdvancedModeEnabled((current) => !current);
};

return (
<StyledContainer>
<StyledIconContainer>
<StyledIconTool size={12} color={MAIN_COLORS.yellow} />
</StyledIconContainer>
<StyledToggleContainer>
<StyledText>Advanced:</StyledText>
<StyledText onClick={toogleAdvancedMode}>Advanced:</StyledText>
<Toggle
onChange={onChange}
color={MAIN_COLORS.yellow}
Expand Down

0 comments on commit fbaace5

Please sign in to comment.