Changeset View
Standalone View
lib/types/avatar-types.js
- This file was added.
// @flow | |||||
export type EmojiAvatarDBContent = { | |||||
ginsu: Also nit but could we rename to `EmojiAvatarContent` I probably will have to use these types in… | |||||
atulAuthorUnsubmitted Done Inline ActionsThe way we're going to represent avatars on the client isn't necessarily how we're going to represent them in the DB. For example, for ImageAvatars on the client, we'll want localMediaUpload and filePaths instead of uploadID. If they end up being the same we can make EmojiAvatarContent an alias of EmojiAvatarDBContent or vice versa. atul: The way we're going to represent avatars on the client isn't necessarily how we're going to… | |||||
+type: 'emoji', | |||||
+emoji: string, | |||||
+color: string, // hex, WITH "#" prefix | |||||
atulAuthorUnsubmitted Done Inline ActionsI know we exclude the # elsewhere, but we end up having to pre-pend it a lot throughout our code. I think it makes sense to store with the #, but happy to remove to keep consistent with thread color and whatnot. atul: I know we exclude the `#` elsewhere, but we end up having to pre-pend it a lot throughout our… | |||||
ginsuUnsubmitted Not Done Inline ActionsWhen I was working on the rendering of the avatars I was under the impression that we wouldn't have #. If it's not a big deal, I would prefer that we drop # to keep it consistent ginsu: When I was working on the rendering of the avatars I was under the impression that we wouldn't… | |||||
atulAuthorUnsubmitted Done Inline Actions
Will make that change atul: > When I was working on the rendering of the avatars I was under the impression that we… | |||||
}; | |||||
export type ImageAvatarDBContent = { | |||||
+type: 'image', | |||||
+uploadID: string, | |||||
atulAuthorUnsubmitted Done Inline ActionsThis uploadID probably won't be used in the fetch query. Instead we'd use the container column of the uploads column to join with the users/threads table. We could separately introduce an avatars table? atul: This `uploadID` probably won't be used in the fetch query. Instead we'd use the `container`… | |||||
}; | |||||
export type AvatarDBContent = EmojiAvatarDBContent | ImageAvatarDBContent; |
Also nit but could we rename to EmojiAvatarContent I probably will have to use these types in the client and I feel like having "db types" in the client is a little strange