mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Fix emoji search due to version change
This commit is contained in:
parent
caec3d415d
commit
e306b5c414
@ -947,7 +947,7 @@ const EditBox: Component<{
|
|||||||
|
|
||||||
// Get index of the token and insert emoji character
|
// Get index of the token and insert emoji character
|
||||||
const index = msg.slice(0, cursor).lastIndexOf(':');
|
const index = msg.slice(0, cursor).lastIndexOf(':');
|
||||||
const value = msg.slice(0, index) + emoji.char + msg.slice(cursor);
|
const value = msg.slice(0, index) + emoji.name + msg.slice(cursor);
|
||||||
|
|
||||||
// Reset query, update message and text area value
|
// Reset query, update message and text area value
|
||||||
setMessage(value);
|
setMessage(value);
|
||||||
@ -1191,7 +1191,7 @@ const EditBox: Component<{
|
|||||||
class={`${styles.emojiOption} ${highlightedEmoji() === index() ? styles.highlight : ''}`}
|
class={`${styles.emojiOption} ${highlightedEmoji() === index() ? styles.highlight : ''}`}
|
||||||
onClick={() => selectEmoji(emoji)}
|
onClick={() => selectEmoji(emoji)}
|
||||||
>
|
>
|
||||||
{emoji.char}
|
{emoji.name}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
|
@ -759,7 +759,7 @@ const Messages: Component = () => {
|
|||||||
|
|
||||||
// Get index of the token and insert emoji character
|
// Get index of the token and insert emoji character
|
||||||
const index = msg.slice(0, cursor).lastIndexOf(':');
|
const index = msg.slice(0, cursor).lastIndexOf(':');
|
||||||
const value = msg.slice(0, index) + emoji.char + msg.slice(cursor);
|
const value = msg.slice(0, index) + emoji.name + msg.slice(cursor);
|
||||||
|
|
||||||
// Reset query, update message and text area value
|
// Reset query, update message and text area value
|
||||||
setMessage(value);
|
setMessage(value);
|
||||||
@ -1014,7 +1014,7 @@ const Messages: Component = () => {
|
|||||||
class={`${styles.emojiOption} ${highlightedEmoji() === index() ? styles.highlight : ''}`}
|
class={`${styles.emojiOption} ${highlightedEmoji() === index() ? styles.highlight : ''}`}
|
||||||
onClick={() => selectEmoji(emoji)}
|
onClick={() => selectEmoji(emoji)}
|
||||||
>
|
>
|
||||||
{emoji.char}
|
{emoji.name}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
|
6
src/types/primal.d.ts
vendored
6
src/types/primal.d.ts
vendored
@ -525,9 +525,9 @@ export type UserRelation = 'follows' | 'other' | 'any';
|
|||||||
|
|
||||||
export type EmojiOption = {
|
export type EmojiOption = {
|
||||||
keywords: string[],
|
keywords: string[],
|
||||||
char: string,
|
char?: string,
|
||||||
fitzpatrick_scale: boolean,
|
fitzpatrick_scale?: boolean,
|
||||||
category: string,
|
category?: string,
|
||||||
name: string,
|
name: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user