Repository navigation
fix: show an unnamed channel with the same title and avatar in every channel view #3473
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
base: master
Are you sure you want to change the base?
Changes from all commits
1315bb4
578e7c3
2e8a88b
1fbc26a
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 |
|---|---|---|
|
|
@@ -14,6 +14,12 @@ export type GroupAvatarProps = { | |
| displayMembers?: GroupAvatarMember[]; | ||
| size: '2xl' | 'xl' | 'lg' | (string & {}) | null; | ||
| badgeSize?: BadgeSize; | ||
| /** | ||
| * Icon of the single `Avatar` rendered for fewer than 2 `displayMembers`. It shows when that | ||
| * member has neither an image nor a name to take initials from, or when there is no member. | ||
| * Defaults to the `IconUser` slot. The member tiles rendered for 2 or more members ignore it. | ||
| */ | ||
| FallbackIcon?: AvatarProps['FallbackIcon']; | ||
| isOnline?: boolean; | ||
| } & ComponentPropsWithoutRef<'div'>; | ||
|
|
||
|
|
@@ -26,6 +32,7 @@ export const GroupAvatar = ({ | |
| badgeSize, | ||
| className, | ||
| displayMembers = [], | ||
| FallbackIcon, | ||
| isOnline, | ||
| size, | ||
| ...rest | ||
|
|
@@ -41,6 +48,8 @@ export const GroupAvatar = ({ | |
|
|
||
| return ( | ||
| <Avatar | ||
| className={className} | ||
| FallbackIcon={FallbackIcon} | ||
|
Member
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. Not new in this PR, but it's the branch being edited: Suggested fix: pass
Contributor
Author
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. Fixed in 2e8a88b: the single |
||
| imageUrl={firstUser?.imageUrl} | ||
| isOnline={isOnline} | ||
| size={size} | ||
|
|
||
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.
Small inconsistency: the title above (line 47) still comes from
useChannelPreviewInfo({ channel }).displayTitle, which now never falls back to the author. So in this recipe a thread in an unnamed channel reads "Unnamed channel", while the SDK'sThreadListItemUIshows the author's name, as the PR description says. SuggestuseThreadPreviewInfo({ thread }), as the thread-header recipe now uses.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.
The title here changed only because
useChannelPreviewInfo().displayTitlehad started returning "Unnamed channel". With 1fbc26a the hook returnsundefinedagain, soThreadRowis back to its output on master. It keepsuseChannelPreviewInforather thanuseThreadPreviewInfobecause this label is the channel ("# β¦"); titling it after the thread author would read as if the author were the channel.