Mixins / foldkit-mixins-ui

ChatMessageReaction

interface · packages/mixins-ui/src/chatMessage.ts:96

interface ChatMessageReaction<Message> {
  readonly key: string
  readonly mark: string
  readonly label: string
  readonly count?: number | undefined
  readonly pressed?: boolean | undefined
  readonly onClick?: Message | undefined
}

An emoji or a glyph someone gave a message, with how many did.

Members

ChatMessageReaction.key

property · packages/mixins-ui/src/chatMessage.ts:98

readonly key: string

Keeps the reaction's DOM when the ones before it change.

ChatMessageReaction.mark

property · packages/mixins-ui/src/chatMessage.ts:100

readonly mark: string

What is drawn: an emoji or a glyph.

ChatMessageReaction.label

property · packages/mixins-ui/src/chatMessage.ts:102

readonly label: string

Its name for a reader: Thumbs up.

ChatMessageReaction.count

property · packages/mixins-ui/src/chatMessage.ts:103

readonly count?: number | undefined

ChatMessageReaction.pressed

property · packages/mixins-ui/src/chatMessage.ts:105

readonly pressed?: boolean | undefined

A toggle's state (you gave this one), as aria-pressed.

ChatMessageReaction.onClick

property · packages/mixins-ui/src/chatMessage.ts:107

readonly onClick?: Message | undefined

Makes it a button that sends this; without it the reaction is shown, not pressed.