Better handling of overflow on long label names, hide Subscriptions if user does not have any

This commit is contained in:
Jackson Harper
2023-05-25 16:44:18 +08:00
parent f3a5fbe457
commit b0bfded57e

View File

@ -155,6 +155,10 @@ function Subscriptions(props: LibraryFilterMenuProps): JSX.Element {
[subscriptions]
)
if (subscriptions.length < 1) {
return <></>
}
return (
<MenuPanel
title="Subscriptions"
@ -374,6 +378,8 @@ function LabelButton(props: LabelButtonProps): JSX.Element {
color: '$thTextSubtle',
verticalAlign: 'middle',
borderRadius: '3px',
cursor: 'pointer',
m: '0px',
'&:hover': {
backgroundColor: '$thBackground4',
@ -382,7 +388,16 @@ function LabelButton(props: LabelButtonProps): JSX.Element {
alignment="center"
distribution="start"
>
<label htmlFor={labelId} style={{ width: '100%' }}>
<label
htmlFor={labelId}
style={{
width: '100%',
maxWidth: '170px',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}}
>
<Circle size={9} color={props.label.color} weight="fill" />
<SpanBox css={{ pl: '10px' }}>{props.label.name}</SpanBox>
</label>