same-person-but-title

This commit is contained in:
tonyrewin 2022-12-07 10:50:24 +03:00
parent fe4f55ad11
commit 47822553bd
3 changed files with 3 additions and 7 deletions

View File

@ -39,11 +39,7 @@ const DialogCard = (props: DialogProps) => {
</Switch> </Switch>
</div> </div>
<div class={styles.row}> <div class={styles.row}>
<div class={styles.name}> <div class={styles.name}>{props.title}</div>
<Switch fallback={names()}>
<Match when={companions().length > 1}>{props.title}</Match>
</Switch>
</div>
<div class={styles.message}> <div class={styles.message}>
<Switch> <Switch>
<Match when={props.message && !props.isChatHeader}>{props.message}</Match> <Match when={props.message && !props.isChatHeader}>{props.message}</Match>

View File

@ -11,7 +11,7 @@ const DialogHeader = (props: DialogHeader) => {
<header class={styles.DialogHeader}> <header class={styles.DialogHeader}>
<DialogCard <DialogCard
isChatHeader={true} isChatHeader={true}
title={props.chat.title} title={props.chat.title || props.chat.members[0].name}
members={props.chat.members} members={props.chat.members}
ownId={props.ownId} ownId={props.ownId}
/> />

View File

@ -185,7 +185,7 @@ export const InboxView = () => {
{(chat) => ( {(chat) => (
<DialogCard <DialogCard
onClick={() => handleOpenChat(chat)} onClick={() => handleOpenChat(chat)}
title={chat.title} title={chat.title || chat.members[0].name}
members={chat.members} members={chat.members}
ownId={currentUserId()} ownId={currentUserId()}
lastUpdate={chat.updatedAt} lastUpdate={chat.updatedAt}