Skip to content

Commit

Permalink
fix: set max width to note tag text
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed Jun 3, 2021
1 parent 31d454c commit 4f729c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
5 changes: 1 addition & 4 deletions app/assets/javascripts/components/NoteTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ type Props = {
};

export const NoteTag = observer(({ appState, tag }: Props) => {
const { tagsContainerMaxWidth } = appState.noteTags;

const [showDeleteButton, setShowDeleteButton] = useState(false);
const deleteTagRef = useRef<HTMLButtonElement>();

Expand Down Expand Up @@ -58,14 +56,13 @@ export const NoteTag = observer(({ appState, tag }: Props) => {
}
}}
className="sn-tag pl-1 pr-2 mr-2"
style={{ maxWidth: tagsContainerMaxWidth }}
onClick={onTagClick}
onKeyDown={onKeyDown}
onFocus={onFocus}
onBlur={onBlur}
>
<Icon type="hashtag" className="sn-icon--small color-info mr-1" />
<span className="whitespace-nowrap overflow-hidden overflow-ellipsis">
<span className="whitespace-nowrap overflow-hidden overflow-ellipsis max-w-290px">
{tag.title}
</span>
{showDeleteButton && (
Expand Down
25 changes: 2 additions & 23 deletions app/assets/stylesheets/_sn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,9 @@
width: 2rem;
}

.max-w-60 {
max-width: 15rem;
.max-w-290px {
max-width: 290px;
}

.max-w-xs {
max-width: 20rem;
}
Expand Down Expand Up @@ -294,30 +293,10 @@
white-space: nowrap;
}

.transition-height {
transition-property: height;
}

.transition-opacity {
transition-property: opacity;
}

.opacity-0 {
opacity: 0;
}

.opacity-1 {
opacity: 1;
}

.w-80 {
width: 20rem;
}

.relative {
position: relative;
}

/**
* A button that is just an icon. Separated from .sn-button because there
* is almost no style overlap.
Expand Down

0 comments on commit 4f729c7

Please sign in to comment.