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

feat: adding the possibility to use emoji default of system #497

Merged
merged 6 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { consume } from '@lit/context';
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { when } from 'lit/directives/when.js';
import type { LightTheme } from '../../types.js';
import { messagesLightTheme } from '../discord-messages/DiscordMessages.js';

Expand Down Expand Up @@ -131,7 +132,11 @@ export class DiscordReaction extends LitElement implements LightTheme {

protected override render() {
return html`<div class="discord-reaction-inner" @click=${this.handleReactionClick} @keydown=${this.handleReactionClick}>
<img src=${ifDefined(this.emoji)} alt=${ifDefined(this.name)} draggable="false" />
${when(
this.emoji.includes('http') || this.emoji.startsWith('/') || this.emoji.startsWith('./'),
() => html`<img src=${ifDefined(this.emoji)} alt=${ifDefined(this.name)} draggable="false" />`,
() => html`<span>${this.emoji}</span>`
)}
<span class="discord-reaction-count">${this.count}</span>
</div>`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,18 @@ export class DiscordStringSelectMenuOption extends LitElement implements LightTh

return html`
<label>
${when(
this.emoji,
() =>
html`<img
src=${this.emoji}
alt=${ifDefined(this.emojiName)}
draggable="true"
class="discord-string-select-menu-option-emoji"
/>`
${when(this.emoji, () =>
when(
this.emoji.includes('http') || this.emoji.startsWith('/') || this.emoji.startsWith('./'),
() =>
html`<img
src=${this.emoji}
alt=${ifDefined(this.emojiName)}
draggable="true"
class="discord-string-select-menu-option-emoji"
/>`,
() => html`<span class="discord-string-select-menu-option-emoji">${this.emoji}</span>`
)
)}
<div class="discord-string-select-menu-option-ellipsis-text">
<div class="discord-string-select-menu-option-ellipsis-text">
Expand Down