Tasks: hides Sidebar amount if value 0

Tasks: makes amount conditional more concise
master
Andrew P Maney 5 years ago committed by Tom Hacohen
parent e008bc19e8
commit 74ed60a3fb

@ -16,7 +16,7 @@ interface ListItemPropsType {
name: string | null;
icon?: React.ReactElement;
primaryText: string;
amount?: number;
amount: number;
}
function SidebarListItem(props: ListItemPropsType) {
@ -34,7 +34,7 @@ function SidebarListItem(props: ListItemPropsType) {
onClick={handleClick}
selected={name === filterBy}
leftIcon={icon}
rightIcon={<span style={{ width: '100%', textAlign: 'right' }}>{amount}</span>}
rightIcon={<span style={{ width: '100%', textAlign: 'right' }}>{(amount > 0) && amount}</span>}
primaryText={primaryText}
/>
);

Loading…
Cancel
Save