Prevent clicking on disabled sidebar items

This commit is contained in:
jeffvli 2023-05-21 19:39:40 -07:00
parent d96c0d547a
commit 5b98238b3a

View file

@ -11,6 +11,8 @@ const Container = styled(Flex)<{ $active?: boolean; $disabled?: boolean }>`
border-right: var(--sidebar-border); border-right: var(--sidebar-border);
cursor: ${(props) => (props.$disabled ? 'default' : 'pointer')}; cursor: ${(props) => (props.$disabled ? 'default' : 'pointer')};
opacity: ${(props) => props.$disabled && 0.6}; opacity: ${(props) => props.$disabled && 0.6};
user-select: ${(props) => (props.$disabled ? 'none' : 'initial')};
pointer-events: ${(props) => (props.$disabled ? 'none' : 'all')};
svg { svg {
fill: ${(props) => (props.$active ? 'var(--primary-color)' : 'var(--sidebar-fg)')}; fill: ${(props) => (props.$active ? 'var(--primary-color)' : 'var(--sidebar-fg)')};