diff --git a/src/app/features/room-nav/RoomNavCategoryButton.tsx b/src/app/features/room-nav/RoomNavCategoryButton.tsx index 3df48aa7d..462bd370f 100644 --- a/src/app/features/room-nav/RoomNavCategoryButton.tsx +++ b/src/app/features/room-nav/RoomNavCategoryButton.tsx @@ -1,26 +1,46 @@ -import { as, Chip, Icon, Icons, Text } from 'folds'; +import { as, Chip, Icon, IconButton, Icons, Text } from 'folds'; import classNames from 'classnames'; import * as css from './styles.css'; export const RoomNavCategoryButton = as<'button', { closed?: boolean }>( - ({ className, closed, children, ...props }, ref) => ( - { + if (children) + return ( + + } + {...props} + ref={ref} + > + {children && ( + + {children} + + )} + + ); + return ( + - } - {...props} - ref={ref} - > - - {children} - - - ) + + ); + } ); diff --git a/src/app/features/room-nav/RoomNavItem.tsx b/src/app/features/room-nav/RoomNavItem.tsx index a372b975a..5371d046f 100644 --- a/src/app/features/room-nav/RoomNavItem.tsx +++ b/src/app/features/room-nav/RoomNavItem.tsx @@ -252,6 +252,9 @@ const RoomNavItemMenu = forwardRef( } ); +export const hideTextStyling = (isHidden: boolean | undefined) => + isHidden ? { width: '100%', height: '100%', padding: '0', paddingTop: '0px' } : {}; + type RoomNavItemProps = { room: Room; selected: boolean; @@ -260,6 +263,7 @@ type RoomNavItemProps = { showAvatar?: boolean; direct?: boolean; customDMCards?: boolean; + hideText?: boolean; }; export function RoomNavItem({ @@ -270,6 +274,7 @@ export function RoomNavItem({ customDMCards, notificationMode, linkPath, + hideText, }: RoomNavItemProps) { const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); @@ -374,9 +379,12 @@ export function RoomNavItem({ .flat() .filter(Boolean) .join(', '); - return ( - + - - - - - ) - } - > - - {showAvatar ? ( - ( - - {nameInitials(roomName)} - - )} - /> - ) : ( - - )} - - - - - {roomName} - - {roomTopic && ( - + {roomName} + + ) + } + > + {(triggerRef) => ( + + + + + ) + } + style={hideTextStyling(hideText)} > - {roomTopic} - - )} - - {!optionsVisible && !unread && !selected && typingMember.length > 0 && ( - - - - )} - {!optionsVisible && shouldShowUnreadIndicator && ( - - 0} - count={unreadCount} - dm={direct} - /> - - )} - {!optionsVisible && notificationMode !== RoomNotificationMode.Unset && ( - - )} - {(room.isCallRoom() || direct) && callMembers.length > 0 && !optionsVisible && ( - - - - - {direct ? 'Calling' : `${callMembers.length} Live`} - - - - )} - - - + + {showAvatar ? ( + ( + + {nameInitials(roomName)} + + )} + /> + ) : ( + + )} + + + {!hideText && ( + <> + + + {roomName} + + {roomTopic && ( + + {roomTopic} + + )} + + {!optionsVisible && !unread && !selected && typingMember.length > 0 && ( + + + + )} + {!optionsVisible && shouldShowUnreadIndicator && ( + + 0} + count={unreadCount} + dm={direct} + /> + + )} + {!optionsVisible && notificationMode !== RoomNotificationMode.Unset && ( + + )} + {(room.isCallRoom() || direct) && + callMembers.length > 0 && + !optionsVisible && ( + + + + + {direct ? 'Calling' : `${callMembers.length} Live`} + + + + )} + > + )} + + + + )} + {optionsVisible && ( - {(room.isCallRoom() || (direct && callMembers.length > 0)) && ( + {(room.isCallRoom() || (direct && callMembers.length > 0)) && !hideText && ( } > - - - + {!hideText && ( + + + + )} )} diff --git a/src/app/features/space-nav/SpaceNavItem.tsx b/src/app/features/space-nav/SpaceNavItem.tsx index f99c0b616..9e9a9abfe 100644 --- a/src/app/features/space-nav/SpaceNavItem.tsx +++ b/src/app/features/space-nav/SpaceNavItem.tsx @@ -11,9 +11,10 @@ type SpaceNavItemProps = { room: Room; selected: boolean; linkPath: string; + hideText?: boolean; }; -export function SpaceNavItem({ room, selected, linkPath }: SpaceNavItemProps) { +export function SpaceNavItem({ room, selected, linkPath, hideText }: SpaceNavItemProps) { const [menuAnchor, setMenuAnchor] = useState(); const matrixRoomName = useRoomName(room); @@ -58,11 +59,13 @@ export function SpaceNavItem({ room, selected, linkPath }: SpaceNavItemProps) { size="100" /> - - - {roomName} - - + {!hideText && ( + + + {roomName} + + + )} diff --git a/src/app/pages/client/direct/Direct.tsx b/src/app/pages/client/direct/Direct.tsx index 57749ae55..f262df9af 100644 --- a/src/app/pages/client/direct/Direct.tsx +++ b/src/app/pages/client/direct/Direct.tsx @@ -247,6 +247,7 @@ export function Direct() { ); const screenSize = useScreenSizeContext(); + const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile; return ( <> @@ -309,18 +310,32 @@ export function Direct() { key={vItem.index} ref={virtualizer.measureElement} > - + + + ); })} diff --git a/src/app/pages/client/sidebar/SidebarResizer.css.ts b/src/app/pages/client/sidebar/SidebarResizer.css.ts index 4f270bf09..15b666e97 100644 --- a/src/app/pages/client/sidebar/SidebarResizer.css.ts +++ b/src/app/pages/client/sidebar/SidebarResizer.css.ts @@ -10,7 +10,6 @@ export const SidebarResizer = style({ export const SidebarResizerHover = style({ height: '100%', zIndex: '100', - boxShadow: `0px 0px 32px 8px ${color.Primary.Main}`, }); export const SideBarResizerAnimation = style({ width: '100%', diff --git a/src/app/pages/client/space/Space.css.ts b/src/app/pages/client/space/Space.css.ts new file mode 100644 index 000000000..b55935156 --- /dev/null +++ b/src/app/pages/client/space/Space.css.ts @@ -0,0 +1,12 @@ +import { style } from '@vanilla-extract/css'; + +export const SmartIcon = style({ + selectors: { + [`& > *`]: { + width: '100%', + aspectRatio: '1', + }, + }, + width: '100%', + aspectRatio: '1', +}); diff --git a/src/app/pages/client/space/Space.tsx b/src/app/pages/client/space/Space.tsx index eb501e5ff..4e7a25b32 100644 --- a/src/app/pages/client/space/Space.tsx +++ b/src/app/pages/client/space/Space.tsx @@ -398,7 +398,7 @@ export function Space() { const showIcons = () => { if (showRoomIcon === ShowRoomIcon.Always) return true; if (showRoomIcon === ShowRoomIcon.Never) return false; - return curWidth < 96; + return curWidth < 144; }; useEffect(() => { setCurWidth(roomSidebarWidth); @@ -726,12 +726,13 @@ export function Space() { }, [lastRoomId, spaceIdOrAlias, mx, navigate]); const screenSize = useScreenSizeContext(); - + const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile; + const hideText = curWidth < 96 && !isMobile; return ( <> @@ -750,14 +751,19 @@ export function Space() { - + - - - Lobby - - + {!hideText && ( + + + Lobby + + + )} @@ -766,13 +772,18 @@ export function Space() { - + - - Message Search - + {!hideText && ( + + Message Search + + )} @@ -801,14 +812,19 @@ export function Space() { ref={virtualizer.measureElement} > @@ -828,14 +844,14 @@ export function Space() { key={vItem.index} ref={virtualizer.measureElement} > - - + + - {roomId === space.roomId ? 'Rooms' : room?.name} + {!hideText && (roomId === space.roomId ? 'Rooms' : room?.name)} @@ -849,13 +865,25 @@ export function Space() { key={vItem.index} ref={virtualizer.measureElement} > - +