Skip to content

Commit

Permalink
Modify display of filter badges
Browse files Browse the repository at this point in the history
This shifts the active/inactive icon to the RHS of the filter badge based on feedback from testing.
  • Loading branch information
jameshadfield committed Nov 6, 2020
1 parent 84498b6 commit 17c8456
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/components/info/filterBadge.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ const TextContainer = styled(BaseContainer)`
background-color: #E9F2F6;
border: 1px solid #BDD8E5;
border-width: 1;
border-radius: 0px 2px 2px 0px;
margin: 0px 2px 0px 0px;
border-radius: ${(props) => props.roundedRHS ? '0px 2px 2px 0px' : ''};
margin: ${(props) => props.roundedRHS ? '0px 2px 0px 0px' : '0px'};
text-decoration: ${(props) => props.active ? "none" : "line-through"};
`;

const IconContainer = styled.div`
cursor: pointer;
color: #5097BA;
border-radius: ${(props) => props.internal ? "0px" : "2px 0px 0px 2px"};
border-width: 1px 0px 1px 1px;
border-radius: ${(props) => props.rhs ? "0px 2px 2px 0px" : "2px 0px 0px 2px"};
border-width: ${(props) => props.rhs ? "1px 1px 1px 0px" : "1px 0px 1px 1px"};
border-style: solid;
border-color: #BDD8E5;
min-width: 20px;
background-color: #E9F2F6;
padding: 0px 0px 0px 2px;
margin: ${(props) => props.internal ? "1px 0px" : "1px 0px 1px 2px"};
margin: ${(props) => props.rhs ? "1px 2px 1px 0px" : "1px 0px 1px 2px"};
display: inline-block;
text-align: center;
&:hover, &:focus {
Expand Down Expand Up @@ -76,14 +76,14 @@ export const FilterBadge = ({remove, canMakeInactive, active, activate, inactiva
<IconContainer onClick={remove} role="button" tabIndex={0}>
<FaTrash/>
</IconContainer>
<TextContainer active={canMakeInactive ? active : true} roundedRHS={!canMakeInactive}>
{children}
</TextContainer>
{canMakeInactive && (
<IconContainer internal onClick={active ? inactivate : activate} role="button" tabIndex={0}>
<IconContainer rhs onClick={active ? inactivate : activate} role="button" tabIndex={0}>
{active ? <FaRegEye/> : <FaRegEyeSlash/>}
</IconContainer>
)}
<TextContainer active={canMakeInactive ? active : true}>
{children}
</TextContainer>
</div>
);
};
Expand Down

0 comments on commit 17c8456

Please sign in to comment.