-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds Spritesheets for Custom Emojis
- Loading branch information
Showing
5 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,7 @@ emojiFallback = (emoji: any, props: any) => emoji ? `:${emoji.shortNames[0]}:` : | |
|
||
## Custom emojis | ||
|
||
You can provide custom emojis which will show up in their own category. | ||
You can provide custom emojis which will show up in their own category. You can either use a single image as imageUrl or use a spritesheet as shown in the second object. | ||
|
||
```ts | ||
const customEmojis = [ | ||
|
@@ -230,6 +230,19 @@ const customEmojis = [ | |
keywords: ['github'], | ||
imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/octocat.png?v7' | ||
}, | ||
{ | ||
name: 'Test Flag', | ||
short_names: ['test'], | ||
text: '', | ||
emoticons: [], | ||
keywords: ['test', 'flag'], | ||
spriteUrl: 'https://unpkg.com/[email protected]/img/twitter/sheets-256/64.png', | ||
sheet_x: 1, | ||
sheet_y: 1, | ||
size: 64, | ||
sheetColumns: 52, | ||
sheetRows: 52, | ||
}, | ||
] | ||
``` | ||
```html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,18 @@ const CUSTOM_EMOJIS = [ | |
keywords: ['github'], | ||
imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/shipit.png?v7', | ||
}, | ||
{ | ||
name: 'Test Flag', | ||
short_names: ['test'], | ||
keywords: ['test', 'flag'], | ||
spriteUrl: | ||
'https://unpkg.com/[email protected]/img/twitter/sheets-256/64.png', | ||
sheet_x: 1, | ||
sheet_y: 1, | ||
size: 64, | ||
sheetColumns: 52, | ||
sheetRows: 52, | ||
}, | ||
]; | ||
|
||
@Component({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters