Skip to content

Commit

Permalink
Wrap variables in CartStatus with accent colour
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Sep 11, 2024
1 parent 2e46573 commit 21f44e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion thallium-frontend/src/components/CartStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ margin-right: 30px;
transition: all 0.25s;
`;

const DetailsSpan = styled.span`
color: ${(props) => props.theme.accent};
font-weight: bold;
font-size: 1.1em;
`

Check failure on line 30 in thallium-frontend/src/components/CartStatus.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

Missing semicolon

const CartStatus = () => {
const cart = useSelector((state: RootState) => state.cart);
const total = cart.cart.reduce((acc, item) => acc + item.quantity, 0);
Expand All @@ -44,7 +50,7 @@ const CartStatus = () => {
};

return <>
<StatusHolder>You currently have {total} item{total !== 1 ? "s" : null} in your cart, totalling ${price.toFixed(2)} USD</StatusHolder>
<StatusHolder>You currently have <DetailsSpan>{total}</DetailsSpan> item{total !== 1 ? "s" : null} in your cart, totalling <DetailsSpan>${price.toFixed(2)} USD</DetailsSpan></StatusHolder>
<Button ref={staticButtonRef} disabled={total === 0} onClick={buttonCallback}>
{checkoutMsg}
</Button>
Expand Down

0 comments on commit 21f44e7

Please sign in to comment.