Skip to content

Commit 01ec473

Browse files
committed
perf: Remove ngx-emoji-mart
1 parent 181ff0a commit 01ec473

File tree

9 files changed

+16
-45
lines changed

9 files changed

+16
-45
lines changed

angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
{
109109
"type": "initial",
110110
"maximumWarning": "500kb",
111-
"maximumError": "1.5mb"
111+
"maximumError": "1mb"
112112
},
113113
{
114114
"type": "anyComponentStyle",

package-lock.json

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"@angular/platform-browser": "~12.2.0",
7777
"@angular/platform-browser-dynamic": "~12.2.0",
7878
"@angular/router": "~12.2.0",
79-
"@ctrl/ngx-emoji-mart": "^6.0.1",
8079
"@ngx-translate/core": "^13.0.0",
8180
"@ngx-translate/http-loader": "^6.0.0",
8281
"@stream-io/transliterate": "^1.5.2",

projects/stream-chat-angular/ng-package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"allowedNonPeerDependencies": [
99
"angular-mentions",
1010
"dayjs",
11-
"@ctrl/ngx-emoji-mart",
1211
"@stream-io/transliterate",
1312
"uuidv4",
1413
"pretty-bytes"

projects/stream-chat-angular/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
},
1818
"dependencies": {
1919
"angular-mentions": "^1.4.0",
20-
"@ctrl/ngx-emoji-mart": "^6.0.1",
2120
"@stream-io/transliterate": "^1.5.2",
2221
"dayjs": "^1.10.7",
2322
"pretty-bytes": "^5.6.0",

projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
"
1313
data-testclass="emoji"
1414
>
15-
<ngx-emoji
16-
emoji="{{ getEmojiNameByReaction(reactionType) }}"
17-
[size]="16"
18-
></ngx-emoji>
15+
<span class="emoji">
16+
{{ getEmojiByReaction(reactionType) }}
17+
</span>
1918
&nbsp;
2019
</li>
2120
<li>
@@ -79,10 +78,9 @@
7978
[size]="20"
8079
></stream-avatar>
8180
</div>
82-
<ngx-emoji
83-
emoji="{{ getEmojiNameByReaction(reactionType) }}"
84-
[size]="20"
85-
></ngx-emoji>
81+
<span class="emoji" style="width: 20px; height: 20px; top: 10px">
82+
{{ getEmojiByReaction(reactionType) }}
83+
</span>
8684
<span
8785
*ngIf="
8886
messageReactionCounts[reactionType] &&

projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
MessageReactionType,
1313
MessageReactionsComponent,
1414
} from './message-reactions.component';
15-
import { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
1615
import { ChannelService } from '../channel.service';
1716
import { SimpleChange } from '@angular/core';
1817

@@ -42,7 +41,6 @@ describe('MessageReactionsComponent', () => {
4241

4342
beforeEach(async () => {
4443
await TestBed.configureTestingModule({
45-
imports: [EmojiModule],
4644
declarations: [MessageReactionsComponent, AvatarComponent],
4745
providers: [{ provide: ChannelService, useValue: channelServiceMock }],
4846
}).compileComponents();

projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ export type MessageReactionType =
2323
| 'wow';
2424

2525
const emojiReactionsMapping: { [key in MessageReactionType]: string } = {
26-
like: 'thumbsup',
27-
angry: 'angry',
28-
love: 'heart',
29-
haha: 'joy',
30-
wow: 'open_mouth',
31-
sad: 'disappointed',
26+
like: '👍',
27+
angry: '😠',
28+
love: '❤️',
29+
haha: '😂',
30+
wow: '😮',
31+
sad: '😞',
3232
};
3333
@Component({
3434
selector: 'stream-message-reactions',
3535
templateUrl: './message-reactions.component.html',
36-
styles: [],
36+
styles: ['.emoji {position: relative; display: inline-block; }'],
3737
})
3838
export class MessageReactionsComponent implements AfterViewChecked, OnChanges {
3939
@Input() messageId: string | undefined;
@@ -101,7 +101,7 @@ export class MessageReactionsComponent implements AfterViewChecked, OnChanges {
101101
?.user;
102102
}
103103

104-
getEmojiNameByReaction(reactionType: MessageReactionType) {
104+
getEmojiByReaction(reactionType: MessageReactionType) {
105105
return emojiReactionsMapping[reactionType];
106106
}
107107

projects/stream-chat-angular/src/lib/stream-chat.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { IconComponent } from './icon/icon.component';
1212
import { MessageActionsBoxComponent } from './message-actions-box/message-actions-box.component';
1313
import { AttachmentListComponent } from './attachment-list/attachment-list.component';
1414
import { MessageReactionsComponent } from './message-reactions/message-reactions.component';
15-
import { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
1615
import { NotificationComponent } from './notification/notification.component';
1716
import { NotificationListComponent } from './notification-list/notification-list.component';
1817
import { TranslateModule } from '@ngx-translate/core';
@@ -43,7 +42,7 @@ import { StreamAvatarModule } from './stream-avatar.module';
4342
TextareaDirective,
4443
HighlightMentionsPipe,
4544
],
46-
imports: [CommonModule, EmojiModule, TranslateModule, StreamAvatarModule],
45+
imports: [CommonModule, TranslateModule, StreamAvatarModule],
4746
exports: [
4847
ChannelComponent,
4948
ChannelHeaderComponent,

0 commit comments

Comments
 (0)