Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Rename annotation to label
Browse files Browse the repository at this point in the history
Signed-off-by: Šimon Brandner <[email protected]>
  • Loading branch information
SimonBrandner committed Dec 5, 2021
1 parent 43abf01 commit 2e4feaf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/views/emojipicker/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class EmojiPicker extends React.Component<IProps, IState> {
};

private emojiMatchesFilter = (emoji: IEmoji, filter: string): boolean => {
return emoji.annotation.toLowerCase().includes(filter) ||
return emoji.label.toLowerCase().includes(filter) ||
emoji.emoticon?.toLowerCase().includes(filter) ||
emoji.shortcodes.some(x => x.toLowerCase().includes(filter)) ||
emoji.unicode.split(ZERO_WIDTH_JOINER).includes(filter);
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/emojipicker/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface IProps {
@replaceableComponent("views.emojipicker.Preview")
class Preview extends React.PureComponent<IProps> {
render() {
const { unicode, annotation, shortcodes: [shortcode] } = this.props.emoji;
const { unicode, label, shortcodes: [shortcode] } = this.props.emoji;

return (
<div className="mx_EmojiPicker_footer mx_EmojiPicker_preview">
Expand All @@ -36,7 +36,7 @@ class Preview extends React.PureComponent<IProps> {
</div>
<div className="mx_EmojiPicker_preview_text">
<div className="mx_EmojiPicker_name mx_EmojiPicker_preview_name">
{ annotation }
{ label }
</div>
<div className="mx_EmojiPicker_shortcode">
{ shortcode }
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/emojipicker/QuickReactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class QuickReactions extends React.Component<IProps, IState> {
{ !this.state.hover
? _t("Quick Reactions")
: <React.Fragment>
<span className="mx_EmojiPicker_name">{ this.state.hover.annotation }</span>
<span className="mx_EmojiPicker_name">{ this.state.hover.label }</span>
<span className="mx_EmojiPicker_shortcode">{ this.state.hover.shortcodes[0] }</span>
</React.Fragment>
}
Expand Down
4 changes: 2 additions & 2 deletions src/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import EMOJIBASE from 'emojibase-data/en/compact.json';
import SHORTCODES from 'emojibase-data/en/shortcodes/iamcal.json';

export interface IEmoji {
annotation: string;
label: string;
group?: number;
hexcode: string;
order?: number;
Expand Down Expand Up @@ -74,7 +74,7 @@ export const EMOJI: IEmoji[] = EMOJIBASE.map((emojiData: Omit<IEmoji, "shortcode
// If there's ever a gap in shortcode coverage, we fudge it by
// filling it in with the emoji's CLDR annotation
const shortcodeData = SHORTCODES[emojiData.hexcode] ??
[emojiData.annotation.toLowerCase().replace(/\W+/g, "_")];
[emojiData.label.toLowerCase().replace(/\W+/g, "_")];

const emoji: IEmoji = {
...emojiData,
Expand Down

0 comments on commit 2e4feaf

Please sign in to comment.