diff --git a/src/app/components/user-profile/PowerChip.tsx b/src/app/components/user-profile/PowerChip.tsx index d1e4dbfa2..ba6440b2c 100644 --- a/src/app/components/user-profile/PowerChip.tsx +++ b/src/app/components/user-profile/PowerChip.tsx @@ -43,6 +43,7 @@ import { useRoomPermissions } from '$hooks/useRoomPermissions'; import { useMemberPowerCompare } from '$hooks/useMemberPowerCompare'; import { CutoutCard } from '$components/cutout-card'; import { PowerColorBadge, PowerIcon } from '$components/power'; +import * as css from './styles.css'; type SelfDemoteAlertProps = { power: number; @@ -144,7 +145,19 @@ function SharedPowerAlert({ power, onCancel, onChange }: SharedPowerAlertProps) ); } -export function PowerChip({ userId }: { userId: string }) { +export function PowerChip({ + userId, + backgroundColor, + innerColor, + cardColor, + textColor, +}: { + userId: string; + backgroundColor?: string; + innerColor?: string; + cardColor?: string; + textColor?: string; +}) { const mx = useMatrixClient(); const room = useRoom(); const space = useSpaceOptionally(); @@ -239,7 +252,11 @@ export function PowerChip({ userId }: { userId: string }) { {error && ( @@ -268,6 +285,7 @@ export function PowerChip({ userId }: { userId: string }) { radii="300" aria-disabled={changing || !canChangePowers || !canAssignPower} aria-pressed={selected} + style={{ backgroundColor: cardColor, color: textColor }} before={} after={ powerTagIconSrc ? ( @@ -285,13 +303,14 @@ export function PowerChip({ userId }: { userId: string }) { ); })} - -
+ +
{ if (room.isSpaceRoom()) { openSpaceSettings( @@ -317,8 +336,14 @@ export function PowerChip({ userId }: { userId: string }) { } > diff --git a/src/app/components/user-profile/UserChips.tsx b/src/app/components/user-profile/UserChips.tsx index 44432df22..01c12ef9a 100644 --- a/src/app/components/user-profile/UserChips.tsx +++ b/src/app/components/user-profile/UserChips.tsx @@ -29,7 +29,6 @@ import { Avatar, } from 'folds'; import { useMatrixClient } from '$hooks/useMatrixClient'; -import { getMxIdServer } from '$utils/matrix'; import { useCloseUserRoomProfile } from '$state/hooks/userRoomProfile'; import { stopPropagation } from '$utils/keyboard'; import { copyToClipboard } from '$utils/dom'; @@ -50,10 +49,21 @@ import { useNickname, useSetNickname } from '$hooks/useNickname'; import { CutoutCard } from '$components/cutout-card'; import { SettingTile } from '$components/setting-tile'; import { RoomAvatar, RoomIcon } from '$components/room-avatar'; +import * as css from './styles.css'; -export function ServerChip({ server }: { server: string }) { - const mx = useMatrixClient(); - const myServer = getMxIdServer(mx.getSafeUserId()); +export function ServerChip({ + server, + innerColor, + cardColor, + textColor, + backgroundColor, +}: { + server: string; + innerColor?: string; + cardColor?: string; + textColor?: string; + backgroundColor?: string; +}) { const navigate = useNavigate(); const closeProfile = useCloseUserRoomProfile(); const [copied, setCopied] = useTimeoutToggle(); @@ -84,9 +94,14 @@ export function ServerChip({ server }: { server: string }) { }} > -
+
Copy Server Explore Community
-
+
Open in Browser @@ -131,7 +149,6 @@ export function ServerChip({ server }: { server: string }) { } > {server} @@ -151,7 +174,19 @@ export function ServerChip({ server }: { server: string }) { ); } -export function ShareChip({ userId }: { userId: string }) { +export function ShareChip({ + userId, + innerColor, + cardColor, + textColor, + backgroundColor, +}: { + userId: string; + innerColor?: string; + cardColor?: string; + textColor?: string; + backgroundColor?: string; +}) { const [cords, setCords] = useState(); const [copied, setCopied] = useTimeoutToggle(); @@ -180,12 +215,12 @@ export function ShareChip({ userId }: { userId: string }) { }} > -
+
{ copyToClipboard(userId); setCopied(); @@ -195,10 +230,10 @@ export function ShareChip({ userId }: { userId: string }) { Copy User ID { copyToClipboard(getMatrixToUser(userId)); setCopied(); @@ -213,7 +248,7 @@ export function ShareChip({ userId }: { userId: string }) { } > Share @@ -239,7 +280,19 @@ type MutualRoomsData = { directs: Room[]; }; -export function MutualRoomsChip({ userId }: { userId: string }) { +export function MutualRoomsChip({ + userId, + backgroundColor, + innerColor, + cardColor, + textColor, +}: { + userId: string; + backgroundColor?: string; + innerColor?: string; + cardColor?: string; + textColor?: string; +}) { const mx = useMatrixClient(); const mutualRoomSupported = useMutualRoomsSupport(); const mutualRoomsState = useMutualRooms(userId); @@ -305,7 +358,7 @@ export function MutualRoomsChip({ userId }: { userId: string }) { fill="None" size="300" radii="300" - style={{ paddingLeft: config.space.S100 }} + style={{ paddingLeft: config.space.S100, backgroundColor: cardColor, color: textColor }} onClick={() => { if (room.isSpaceRoom()) { navigateSpace(roomId); @@ -332,12 +385,17 @@ export function MutualRoomsChip({ userId }: { userId: string }) { )} /> ) : ( - + )} } > - + {room.name} @@ -367,6 +425,7 @@ export function MutualRoomsChip({ userId }: { userId: string }) { display: 'flex', maxWidth: toRem(200), maxHeight: '80vh', + backgroundColor: innerColor, }} > @@ -374,7 +433,7 @@ export function MutualRoomsChip({ userId }: { userId: string }) { {mutual.spaces.length > 0 && ( @@ -409,7 +468,6 @@ export function MutualRoomsChip({ userId }: { userId: string }) { } > } disabled={ @@ -417,8 +475,14 @@ export function MutualRoomsChip({ userId }: { userId: string }) { } onClick={open} aria-pressed={!!cords} + className={css.UserHeroChip} + style={{ + backgroundColor: cardColor, + borderColor: backgroundColor, + color: textColor, + }} > - + {mutualRoomsState.status === AsyncStatus.Success && `${mutualRoomsState.data.length} Mutual Rooms`} {mutualRoomsState.status === AsyncStatus.Loading && 'Mutual Rooms'} @@ -445,7 +509,19 @@ export function IgnoredUserAlert() { ); } -export function OptionsChip({ userId }: { userId: string }) { +export function OptionsChip({ + userId, + backgroundColor, + innerColor, + cardColor, + textColor, +}: { + userId: string; + backgroundColor?: string; + innerColor?: string; + cardColor?: string; + textColor?: string; +}) { const mx = useMatrixClient(); const [cords, setCords] = useState(); const [editingNick, setEditingNick] = useState(false); @@ -510,7 +586,7 @@ export function OptionsChip({ userId }: { userId: string }) { }} > -
+
{editingNick ? ( Save @@ -554,6 +631,7 @@ export function OptionsChip({ userId }: { userId: string }) { setNickname(userId, undefined); close(); }} + style={{ backgroundColor: cardColor, color: textColor }} > Clear @@ -568,6 +646,7 @@ export function OptionsChip({ userId }: { userId: string }) { radii="300" before={} onClick={() => setEditingNick(true)} + style={{ backgroundColor: cardColor, color: textColor }} > {currentNick ? 'Edit Nickname' : 'Set Nickname'} @@ -581,6 +660,7 @@ export function OptionsChip({ userId }: { userId: string }) { toggleIgnore(); close(); }} + style={{ backgroundColor: cardColor }} before={ ignoring ? ( @@ -590,14 +670,26 @@ export function OptionsChip({ userId }: { userId: string }) { } disabled={ignoring} > - {ignored ? 'Unblock User' : 'Block User'} + + {ignored ? 'Unblock User' : 'Block User'} +
} > - + {ignoring ? ( ) : ( diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index 29889b128..9ca4e681a 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -74,6 +74,8 @@ type UserExtendedSectionProps = { profile: UserProfile; htmlReactParserOptions: HTMLReactParserOptions; linkifyOpts: LinkifyOpts; + backgroundColor?: string; + innerColor?: string; cardColor?: string; textColor?: string; }; @@ -82,6 +84,8 @@ function UserExtendedSection({ profile, htmlReactParserOptions, linkifyOpts, + backgroundColor, + innerColor, cardColor, textColor, }: Readonly) { @@ -175,13 +179,24 @@ function UserExtendedSection({ return null; } return ( - + handleMiscSelector(-1)} > @@ -192,8 +207,7 @@ function UserExtendedSection({ size="300" radii="300" fill="None" - variant="Secondary" - style={{ justifyContent: 'Center' }} + style={{ justifyContent: 'Center', backgroundColor: cardColor, color: textColor }} onClick={() => handleMiscSelector(index)} > {key} @@ -201,7 +215,7 @@ function UserExtendedSection({ ))} ); - }, [miscDataIndex, showMisc, unknownFields]); + }, [cardColor, innerColor, miscDataIndex, showMisc, textColor, unknownFields]); const miscHeader = useMemo( () => ( @@ -271,6 +285,9 @@ function UserExtendedSection({ style={{ backgroundColor: cardColor, borderRadius: config.radii.R400, + borderColor: backgroundColor, + borderStyle: 'solid', + borderWidth: '1px', maxHeight: '200px', marginTop: config.space.S0, overflowY: 'auto', @@ -299,6 +316,7 @@ function UserExtendedSection({ backgroundColor: cardColor, borderColor: 'var(--sable-surface-container-line)', borderRadius: config.radii.R400, + borderWidth: '1px', }} > {unknownFields.length > 1 && ( @@ -326,16 +344,23 @@ function UserExtendedSection({ {miscHeader} {unknownFields.length > 1 && ( )} - + } onClick={handleMessage} - style={{ marginLeft: 'auto' }} + style={{ + marginLeft: 'auto', + backgroundColor: cardColor, + borderColor: backgroundColor, + color: textColor, + borderStyle: 'solid', + borderWidth: '1px', + }} > Message @@ -519,15 +551,57 @@ export function UserRoomProfile({ userId, initialProfile }: Readonly - {server && } - - {creator ? : } - {userId !== myUserId && } - {userId !== myUserId && } + {server && ( + + )} + + {creator ? ( + + ) : ( + + )} + {userId !== myUserId && ( + + )} + {userId !== myUserId && ( + + )} {ignored && } diff --git a/src/app/components/user-profile/styles.css.ts b/src/app/components/user-profile/styles.css.ts index 10b0c9e51..465f25924 100644 --- a/src/app/components/user-profile/styles.css.ts +++ b/src/app/components/user-profile/styles.css.ts @@ -78,3 +78,7 @@ export const UserHeroAvatarImg = style({ }, }, }); +export const UserHeroChip = style({ + borderStyle: 'solid', + borderWidth: '1px', +});