mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 18:43:41 -05:00
web/rightpanel: use border-bottom instead of hr for separators
This commit is contained in:
parent
b7cc6aff86
commit
bdae0c416f
3 changed files with 18 additions and 24 deletions
|
@ -91,6 +91,12 @@ div.right-panel-content.user {
|
|||
word-break: break-word;
|
||||
}
|
||||
|
||||
div.userid, div.extended-profile, div.devices, div.user-moderation, div.mutual-rooms, div.errors {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding-bottom: .5rem;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
div.extended-profile {
|
||||
display: grid;
|
||||
gap: 0.25rem;
|
||||
|
|
|
@ -4,7 +4,7 @@ import { PronounSet, UserProfile } from "@/api/types"
|
|||
import { ensureArray, ensureString } from "@/util/validation.ts"
|
||||
|
||||
interface ExtendedProfileProps {
|
||||
profile: UserProfile
|
||||
profile: UserProfile | null
|
||||
refreshProfile: () => void
|
||||
client: Client
|
||||
userID: string
|
||||
|
@ -105,18 +105,15 @@ const UserExtendedProfile = ({ profile, refreshProfile, client, userID }: Extend
|
|||
|
||||
const pronouns = ensureArray(profile["io.fsky.nyx.pronouns"]) as PronounSet[]
|
||||
const userTimeZone = ensureString(profile["us.cloke.msc4175.tz"])
|
||||
return <>
|
||||
<hr/>
|
||||
<div className="extended-profile">
|
||||
{userTimeZone && <ClockElement tz={userTimeZone} />}
|
||||
{userID === client.userID &&
|
||||
<SetTimeZoneElement tz={userTimeZone} client={client} refreshProfile={refreshProfile} />}
|
||||
{pronouns.length > 0 && <>
|
||||
<div>Pronouns:</div>
|
||||
<div>{pronouns.map(pronounSet => ensureString(pronounSet.summary)).join(", ")}</div>
|
||||
</>}
|
||||
</div>
|
||||
</>
|
||||
return <div className="extended-profile">
|
||||
{userTimeZone && <ClockElement tz={userTimeZone} />}
|
||||
{userID === client.userID &&
|
||||
<SetTimeZoneElement tz={userTimeZone} client={client} refreshProfile={refreshProfile} />}
|
||||
{pronouns.length > 0 && <>
|
||||
<div>Pronouns:</div>
|
||||
<div>{pronouns.map(pronounSet => ensureString(pronounSet.summary)).join(", ")}</div>
|
||||
</>}
|
||||
</div>
|
||||
}
|
||||
|
||||
export default UserExtendedProfile
|
||||
|
|
|
@ -70,22 +70,13 @@ const UserInfo = ({ userID }: UserInfoProps) => {
|
|||
</div>
|
||||
<div className="displayname" title={displayname}>{displayname}</div>
|
||||
<div className="userid" title={userID}>{userID}</div>
|
||||
{globalProfile && <UserExtendedProfile
|
||||
profile={globalProfile} refreshProfile={refreshProfile} client={client} userID={userID}
|
||||
/>}
|
||||
<hr/>
|
||||
<UserExtendedProfile profile={globalProfile} refreshProfile={refreshProfile} client={client} userID={userID}/>
|
||||
<DeviceList client={client} room={roomCtx?.store} userID={userID}/>
|
||||
<hr/>
|
||||
{userID !== client.userID && <>
|
||||
<MutualRooms client={client} userID={userID}/>
|
||||
<hr/>
|
||||
<UserModeration client={client} room={roomCtx?.store} member={memberEvt} userID={userID}/>
|
||||
<hr/>
|
||||
</>}
|
||||
{errors?.length ? <>
|
||||
<UserInfoError errors={errors}/>
|
||||
<hr/>
|
||||
</> : null}
|
||||
<UserInfoError errors={errors}/>
|
||||
</>
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue