Skip to content

Commit

Permalink
chore: ignore nested ternaries
Browse files Browse the repository at this point in the history
  • Loading branch information
vacekj committed Aug 26, 2024
1 parent 72214c2 commit b56acb7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/ui/src/AccountSelector/AccountSelectorAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const TextWrapper = styled.div`
`;

const getAddressColor = (loading: boolean, ephemeral: boolean) => (color: DefaultTheme['color']) =>
// eslint-disable-next-line no-nested-ternary -- readable ternary
loading ? color.text.muted : ephemeral ? color.text.special : color.text.primary;

export interface AccountSelectorAddressProps {
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/AssetIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ export const AssetIcon = ({ metadata }: AssetIcon) => {

return (
<BorderWrapper>
{/* eslint-disable-next-line no-nested-ternary -- readable ternary */}
{icon ? (
<IconImg src={icon} alt='Asset icon' />
) : isDelegationToken ? (
) : // eslint-disable-next-line no-nested-ternary -- readable ternary
isDelegationToken ? (
<DelegationTokenIcon displayDenom={display} />
) : isUnbondingToken ? (
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const StyledButton = styled(motion.button)<StyledButtonProps>`
${buttonBase}
${button}
background-color: ${props =>
background-color: ${props =>
getBackgroundColor(props.$actionType, props.$priority, props.theme, props.$iconOnly)};
outline: ${props =>
props.$priority === 'secondary'
Expand All @@ -80,12 +80,12 @@ const StyledButton = styled(motion.button)<StyledButtonProps>`
position: relative;
${props =>
// eslint-disable-next-line no-nested-ternary -- readable ternary
props.$iconOnly === 'adornment'
? iconOnlyAdornment
: props.$density === 'sparse'
? sparse
: compact}
&::after {
outline-offset: -2px;
}
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/Colors.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const Variant = styled.div<VariantProps>`
props.$color === 'text' ? 'transparent' : props.theme.color[props.$color][props.$colorVariant]};
border-radius: ${props => props.theme.borderRadius.xl};
color: ${props =>
// eslint-disable-next-line no-nested-ternary -- readable ternary
props.$color === 'text'
? props.theme.color.text[props.$colorVariant]
: props.$colorVariant === 'contrast' || props.$colorVariant === 'light'
Expand Down

0 comments on commit b56acb7

Please sign in to comment.