HomePhabricator
Diffusion Comm 112846eaebdd

[lib] introduce useGetAvatarForThread hook

Description

[lib] introduce useGetAvatarForThread hook

Summary:
introduce useGetAvatarForThread hook. When thinking about thread avatars, there are three main thread avatars we need to consider

  1. channels/group chats
  2. private aka the chat with yourself (introduced in D7178)
  3. personal aka 1on1 chat with another user (introduced in D7178)

Another thing we needed to consider when building this hook is that the thread avatar should default the channel thread avatar to their community's avatar, but we do need to should special-case GENESIS and make it an exception (otherwise, all DMs / group chats will default to the GENESIS avatar)


Depends on D7178

Test Plan:
Please check out these screenshots to see that the thread avatars are getting defaulted to the community avatar for non-genesis communities, and all chats under genesis are getting a randomly generated thread avatar

Non-genesis community:

Screenshot 2023-03-24 at 3.04.13 PM.png (1×1 px, 808 KB)

Genesis chats:

Screenshot 2023-03-24 at 3.04.22 PM.png (1×1 px, 830 KB)

Reviewers: ashoat, atul

Reviewed By: ashoat

Subscribers: ashoat, tomek, atul

Differential Revision: https://phab.comm.dev/D7132

Details

Provenance
ginsuAuthored on Mar 26 2023, 7:15 PM
Reviewer
ashoat
Differential Revision
D7132: [lib] introduce useGetAvatarForThread hook
Parents
rCOMM82a9fdc14701: [lib] introduce getUserAvatarForThread function
Branches
Unknown
Tags
Unknown