Skip to content

Commit

Permalink
chore: use explicit images for inverted operator rather than a boolea…
Browse files Browse the repository at this point in the history
…n not operator (#5565)
  • Loading branch information
sighphyre committed Dec 7, 2023
1 parent e89ebf3 commit 0e5861a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
3 changes: 0 additions & 3 deletions frontend/src/assets/icons/24_Negator off.svg

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/assets/icons/24_Negator.svg

This file was deleted.

5 changes: 5 additions & 0 deletions frontend/src/assets/icons/not_operator_selected.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/src/assets/icons/not_operator_unselected.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,6 +1,6 @@
import { Box, Tooltip } from '@mui/material';
import { ReactComponent as NegatedIcon } from 'assets/icons/24_Negator.svg';
import { ReactComponent as NegatedIconOff } from 'assets/icons/24_Negator off.svg';
import { ReactComponent as NegatedOnIcon } from 'assets/icons/not_operator_selected.svg';
import { ReactComponent as NegatedOffIcon } from 'assets/icons/not_operator_unselected.svg';
import { IConstraint } from 'interfaces/strategy';
import {
StyledToggleButtonOff,
Expand Down Expand Up @@ -30,15 +30,15 @@ export const InvertedOperatorButton = ({
onClick={setInvertedOperator}
disableRipple
>
<NegatedIcon />
<NegatedOnIcon />
</StyledToggleButtonOn>
}
elseShow={
<StyledToggleButtonOff
onClick={setInvertedOperator}
disableRipple
>
<NegatedIconOff />
<NegatedOffIcon />
</StyledToggleButtonOff>
}
/>
Expand Down
Expand Up @@ -2,11 +2,12 @@ import { IConstraint } from 'interfaces/strategy';
import { ConditionallyRender } from '../../../ConditionallyRender/ConditionallyRender';
import { Tooltip, Box, styled } from '@mui/material';
import { stringOperators } from 'constants/operators';
import { ReactComponent as NegatedIcon } from 'assets/icons/24_Negator.svg';
import { ReactComponent as NegatedOnIcon } from 'assets/icons/not_operator_selected.svg';
import { ConstraintOperator } from '../../ConstraintOperator/ConstraintOperator';
import { StyledIconWrapper } from './StyledIconWrapper';
import { ReactComponent as CaseSensitive } from 'assets/icons/24_Text format.svg';
import { oneOf } from 'utils/oneOf';
import { useTheme } from '@mui/material';

interface ConstraintViewHeaderOperatorProps {
constraint: IConstraint;
Expand All @@ -31,6 +32,7 @@ export const ConstraintViewHeaderOperator = ({
constraint,
disabled = false,
}: ConstraintViewHeaderOperatorProps) => {
const theme = useTheme();
return (
<StyledHeaderValuesContainerWrapper>
<ConditionallyRender
Expand All @@ -39,7 +41,7 @@ export const ConstraintViewHeaderOperator = ({
<Tooltip title={'Operator is negated'} arrow>
<Box sx={{ display: 'flex' }}>
<StyledIconWrapper isPrefix>
<NegatedIcon />
<NegatedOnIcon />
</StyledIconWrapper>
</Box>
</Tooltip>
Expand Down
Expand Up @@ -16,7 +16,10 @@ export const StyledIconWrapperBase = styled('div')<{
borderRadius: theme.shape.borderRadius,
}));

const StyledPrefixIconWrapper = styled(StyledIconWrapperBase)(() => ({
const StyledPrefixIconWrapper = styled(StyledIconWrapperBase)(({ theme }) => ({
width: 'auto',
paddingLeft: theme.spacing(1),
paddingRight: theme.spacing(1),
marginLeft: 0,
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
Expand Down

0 comments on commit 0e5861a

Please sign in to comment.