Skip to content
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

Add slack likes custom emotes #190

Closed
wants to merge 5 commits into from

Conversation

LucasBourgeois
Copy link

@LucasBourgeois LucasBourgeois commented Oct 1, 2024

JsonEmoji is now a join of 2 types:

export type JsonEmojiBase = {
  name: string
  keywords?: string[]
}

export type UnicodeJsonEmoji = JsonEmojiBase & {
  emoji: string
  v: string
  toneEnabled: boolean
}

export type UriJsonEmoji = JsonEmojiBase & {
  uri: string
}

export type JsonEmoji = UnicodeJsonEmoji | UriJsonEmoji

export type EmojiTypeBase = {
  name: string
  slug: string
  alreadySelected?: boolean
}

export type UnicodeEmojiType = EmojiTypeBase & {
  emoji: string
  toneEnabled: boolean
  unicode_version: string
}

export type UriEmojiType = EmojiTypeBase & {
  uri: string
}

export type EmojiType = UnicodeEmojiType | UriEmojiType

A new category named "Custom" has been added with the generateIcons script and trad files are up to date (thx google translate)

I used the
emojisByCategory={getCustomEmojis()} prop as an entryPoint to allow ppl to add an UriJsonEmoji[]
Using this, you can set the custom category with UriJsonEmoji[] specifiying the URI, the name and keywords.

SingleEmoji.tsx is checking if an Image or a Text should be rendered using emojiSize.

It's possible to use a base64, a distant https:// image source or a Image.resolveAssetSource(require(assetPath).uri
Doc is up to date
unicode feature like emote tones is disabled for Uri emotes and unicode related info is removed from Uri emojis
Searching in custom category and recently picked + persistency works like a charm 👌

Feel free to give me feedbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant