diff --git a/src/app/components/presence/Presence.tsx b/src/app/components/presence/Presence.tsx index 7b4e558726..787e689aba 100644 --- a/src/app/components/presence/Presence.tsx +++ b/src/app/components/presence/Presence.tsx @@ -25,7 +25,7 @@ type PresenceBadgeProps = { status?: string; size?: '200' | '300' | '400' | '500'; }; -export function PresenceBadge({ presence, status, size }: PresenceBadgeProps) { +export function PresenceBadge({ presence, size }: PresenceBadgeProps) { const label = usePresenceLabel(); const badgeLabelId = useId(); @@ -39,8 +39,6 @@ export function PresenceBadge({ presence, status, size }: PresenceBadgeProps) { {label[presence]} - {status && •} - {status && {status}} } diff --git a/src/app/components/user-profile/UserHero.tsx b/src/app/components/user-profile/UserHero.tsx index 2f6eb84d53..c4824fcfbb 100644 --- a/src/app/components/user-profile/UserHero.tsx +++ b/src/app/components/user-profile/UserHero.tsx @@ -9,14 +9,15 @@ import { OverlayBackdrop, OverlayCenter, Text, + Tooltip, } from 'folds'; import classNames from 'classnames'; import FocusTrap from 'focus-trap-react'; import colorMXID from '$utils/colorMXID'; import { getMxIdLocalPart } from '$utils/matrix'; import { BreakWord, LineClamp3 } from '$styles/Text.css'; -import { UserPresence } from '$hooks/useUserPresence'; -import { stopPropagation } from '$utils/keyboard'; +import { Presence, UserPresence } from '$hooks/useUserPresence'; +import { stopPropagation } from '$appUtils/keyboard'; import { useRoom } from '$hooks/useRoom'; import { useSableCosmetics } from '$hooks/useSableCosmetics'; import { useNickname } from '$hooks/useNickname'; @@ -58,51 +59,58 @@ export function UserHero({ userId, avatarUrl, bannerUrl, presence }: UserHeroPro /> )} -
- - } - > - setViewAvatar(avatarUrl) : undefined} - className={css.UserHeroAvatar} - size="500" + +
+ } > - } - /> - - - {viewAvatar && ( - }> - - setViewAvatar(undefined), - clickOutsideDeactivates: true, - escapeDeactivates: stopPropagation, - }} - > - evt.stopPropagation()}> - setViewAvatar(undefined)} - /> - - - - + setViewAvatar(avatarUrl) : undefined} + className={css.UserHeroAvatar} + size="500" + > + } + /> + + + {viewAvatar && ( + }> + + setViewAvatar(undefined), + clickOutsideDeactivates: true, + escapeDeactivates: stopPropagation, + }} + > + evt.stopPropagation()}> + setViewAvatar(undefined)} + /> + + + + + )} +
+ {presence?.status?.length && ( +
+ + {presence.status} + +
)} -
+ ); } diff --git a/src/app/components/user-profile/styles.css.ts b/src/app/components/user-profile/styles.css.ts index 33fcd0965b..748a7e3ca0 100644 --- a/src/app/components/user-profile/styles.css.ts +++ b/src/app/components/user-profile/styles.css.ts @@ -30,18 +30,29 @@ export const UserHeroCoverFallback = style({ filter: 'blur(16px) brightness(50%)', transform: 'scale(2)', }); - -export const UserHeroAvatarContainer = style({ +export const UserHeroAvatarStatusContainer = style({ position: 'relative', height: toRem(29), + width: '100%', +}); +export const UserHeroAvatarContainer = style({ + position: 'relative', + paddingLeft: config.space.S400, }); export const UserAvatarContainer = style({ - position: 'absolute', - left: config.space.S400, + position: 'relative', top: 0, transform: 'translateY(-50%)', backgroundColor: color.Surface.Container, }); +export const UserHeroStatusContainer = style({ + position: 'relative', + transform: 'translateY(-50%)', + textAlign: 'justify', + display: 'grid', + width: '100%', + paddingLeft: '2%', +}); export const UserHeroAvatar = style({ outline: `${config.borderWidth.B600} solid ${color.Surface.Container}`, selectors: { diff --git a/src/app/features/room/MembersDrawer.tsx b/src/app/features/room/MembersDrawer.tsx index 40c14f2678..d5745bb6fc 100644 --- a/src/app/features/room/MembersDrawer.tsx +++ b/src/app/features/room/MembersDrawer.tsx @@ -59,6 +59,9 @@ import { useRoomCreators } from '$hooks/useRoomCreators'; import { useSableCosmetics } from '$hooks/useSableCosmetics'; import * as css from './MembersDrawer.css'; +import { AvatarPresence, PresenceBadge } from '$components/presence'; +import { useUserPresence } from '$hooks/useUserPresence'; + type MemberDrawerHeaderProps = { room: Room; }; @@ -128,6 +131,8 @@ function MemberItem({ ? mx.mxcUrlToHttp(avatarMxcUrl, 100, 100, 'crop', undefined, false, useAuthentication) : undefined; + const presence = useUserPresence(member.userId); + const { color, font } = useSableCosmetics(member.userId, room); return ( @@ -139,14 +144,18 @@ function MemberItem({ radii="400" onClick={onClick} before={ - - } - /> - + } + > + + } + /> + + } after={ typing && ( @@ -156,10 +165,16 @@ function MemberItem({ ) } > - + {name} + {presence?.status && ( + /*THE COLOR SHOULD BE BASED ON SOMETHING I CANT FIND*/ + + {presence.status} + + )} );