-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(conversation)#WB-3834 draft list message preview #620
Changes from 4 commits
06d3022
c5726a2
2cfb25b
28b5f9f
526c5c9
a723fd9
bc9da43
9ec254c
01e2514
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,9 +4,13 @@ import { MessageMetadata } from '~/models'; | |||||
|
||||||
export interface RecipientListPreviewProps { | ||||||
message: MessageMetadata; | ||||||
hasPrefix?: boolean; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
export function RecipientListPreview({ message }: RecipientListPreviewProps) { | ||||||
export function RecipientListPreview({ | ||||||
message, | ||||||
hasPrefix, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
ou |
||||||
}: RecipientListPreviewProps) { | ||||||
const { t } = useTranslation('conversation'); | ||||||
const to = message.to; | ||||||
const cc = message.cc; | ||||||
|
@@ -17,7 +21,7 @@ export function RecipientListPreview({ message }: RecipientListPreviewProps) { | |||||
}; | ||||||
return ( | ||||||
<MessageRecipientList | ||||||
head={t('at')} | ||||||
head={hasPrefix ? t('at') : null} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
ou |
||||||
recipients={recipients} | ||||||
color="text-gray-800" | ||||||
truncate | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,21 +24,27 @@ export function MessagePreview({ message }: MessagePreviewProps) { | |||||
<IconUndo className="gray-800" title="message-response" /> | ||||||
)} | ||||||
|
||||||
{'outbox' === folderId ? ( | ||||||
{folderId && ['outbox', 'draft'].includes(folderId) ? ( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dans l'ancienne messagerie, les noms des dossiers étaient en majuscule. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Romu-C ce hook sert donc à ça ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. donc on remplace useSelectedFolder partout ? histoire d'être consistant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je vois qu'il y a aussi une constante SYSTEM_FOLDER_ID . Ça serait mieux de l'utiliser non ?
=> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il vaudrait mieux, oui (x2). A discuter plus en détails si le moindre doute persiste. |
||||||
<RecipientAvatar recipients={message.to} /> | ||||||
) : ( | ||||||
<SenderAvatar authorId={message.from.id} /> | ||||||
)} | ||||||
|
||||||
<div className="d-flex flex-fill flex-column overflow-hidden"> | ||||||
<div className="d-flex flex-fill justify-content-between overflow-hidden"> | ||||||
<div className="d-flex flex-fill justify-content-between overflow-hidden gap-4"> | ||||||
{folderId === 'draft' && ( | ||||||
<strong className="text-danger">{t('draft')}</strong> | ||||||
)} | ||||||
<div className="text-truncate flex-fill"> | ||||||
{'outbox' === folderId ? ( | ||||||
<RecipientListPreview message={message} /> | ||||||
) : ( | ||||||
senderDisplayName | ||||||
{folderId === 'draft' && <RecipientListPreview message={message} />} | ||||||
{folderId === 'outbox' && ( | ||||||
<RecipientListPreview message={message} hasPrefix /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
)} | ||||||
{folderId && ['inbox', 'trash'].includes(folderId) && ( | ||||||
<>{senderDisplayName}</> | ||||||
)} | ||||||
</div> | ||||||
|
||||||
<div className="fw-bold text-nowrap fs-12 gray-800"> | ||||||
{fromNow(message.date)} | ||||||
</div> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu peux refacto pour éviter la répétition et virer le else inutile :