add: objectName in fav folder (#8785)

Closes: #8549 

It was quite complex to get this right. So, I went through Notion's
website to see how they implemented it.
Instead of using `display: none` or having a space reserved for the
Icon, I used clip-path & opacity trick to achieve the desired behaviour.
This maintains accessibility and helps in label or ObjectName to take
the full space.

Also, truncation now works for label & objectName as a whole instead of
separately, as seen in my previous PR.

**Caveats**

The only problem that now remains is not having
`NavigationDrawerAnimatedCollapseWrapper`. Having it on top of any text
or div won't let the flex or truncation property work.

[Screencast from 2024-11-28
13-37-31.webm](https://github.com/user-attachments/assets/29255cd2-3f15-4b1d-b1e1-c041c70052e5)

---------

Co-authored-by: ehconitin <nitinkoche03@gmail.com>
Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
Harsh Singh
2024-12-19 16:21:03 +05:30
committed by GitHub
parent 65586a00cc
commit 784bc78ed0
4 changed files with 115 additions and 45 deletions

View File

@ -173,6 +173,7 @@ export const CurrentWorkspaceMemberFavorites = ({
itemComponent={
<NavigationDrawerSubItem
label={favorite.labelIdentifier}
objectName={favorite.objectNameSingular}
Icon={() => <FavoriteIcon favorite={favorite} />}
to={favorite.link}
active={index === selectedFavoriteIndex}

View File

@ -59,6 +59,7 @@ export const CurrentWorkspaceMemberOrphanFavorites = () => {
accent="tertiary"
/>
}
objectName={favorite.objectNameSingular}
isDragging={isDragging}
/>
</StyledOrphanFavoritesContainer>