Skip to content

Commit f01541a

Browse files
authored
Implement Mention Module for User Referencing (#139)
Signed-off-by: Harshil-Jani <[email protected]>
1 parent 2f4e567 commit f01541a

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

package-lock.json

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@scure/bip39": "^1.1.1",
3838
"@twogate/ngx-photo-gallery": "^1.4.0",
3939
"@types/sharedworker": "^0.0.91",
40+
"angular-mentions": "^1.5.0",
4041
"angularx-qrcode": "^15.0.1",
4142
"html5-qrcode": "^2.3.7",
4243
"idb": "^7.1.1",

src/app/app.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { MatStepperModule } from '@angular/material/stepper';
2929
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
3030
import { MatChipsModule } from '@angular/material/chips';
3131
import { MatPaginatorModule } from '@angular/material/paginator';
32+
import { MentionModule } from 'angular-mentions';
3233
import { AuthGuardService } from './services/auth-guard';
3334
import { ConnectComponent } from './connect/connect';
3435
import { LogoutComponent } from './logout/logout';
@@ -294,6 +295,7 @@ import { ExampleComponent } from './example/example';
294295
MatPaginatorModule,
295296
MatSlideToggleModule,
296297
MatAutocompleteModule,
298+
MentionModule,
297299
PickerModule,
298300
FormsModule,
299301
ReactiveFormsModule,

src/app/editor/editor.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<div mat-dialog-content class="mat-dialog-content">
7676
<mat-form-field class="input-full-width">
7777
<mat-label>What's on your mind?</mat-label>
78-
<textarea appContentEditor appAutoInputHeight #noteContent class="note-input noscrollbars" matInput type="text" formControlName="content" rows="2"></textarea>
78+
<textarea appContentEditor appAutoInputHeight #noteContent class="note-input noscrollbars" matInput type="text" formControlName="content" rows="2" [mention]="followingUsers"></textarea>
7979
</mat-form-field>
8080

8181
<!-- <mat-autocomplete #auto="matAutocomplete">

src/app/editor/editor.ts

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export class EditorComponent {
6161

6262
subscriptions: Subscription[] = [];
6363

64+
followingUsers : string [] = this.profileService.following.map(follower => follower.name);
65+
6466
constructor(
6567
private snackBar: MatSnackBar,
6668
public articleService: ArticleService,

0 commit comments

Comments
 (0)