Skip to content

Commit

Permalink
Merge pull request #1888 from citizenos/#1637
Browse files Browse the repository at this point in the history
add login modal
  • Loading branch information
ilmartyrk authored Feb 17, 2025
2 parents 57b1ab3 + 6982d33 commit b25deaa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/app/topic/components/argument/argument.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,10 @@
<button class="btn_ghost_reply_argument" *ngIf="argument.type !== 'reply' && showReplies"
(click)="showReplies = !showReplies" translate="COMPONENTS.ARGUMENT.LNK_HIDE_REPLIES">
</button>
<ng-container *ngIf="Auth.loggedIn$ | async">
<a class="mobile_show" [ngClass]="{disabled: !canReply}" translate="COMPONENTS.ARGUMENT.BTN_REPLY"
(click)="showReply=!showReply"></a>
<button class="btn_reply_argument mobile_hidden" [ngClass]="{disabled: !canReply}"
(click)="showReply=!showReply" translate="COMPONENTS.ARGUMENT.BTN_REPLY"></button>
</ng-container>
<a class="mobile_show" [ngClass]="{disabled: !canReply}" translate="COMPONENTS.ARGUMENT.BTN_REPLY"
(click)="handleShowReply()"></a>
<button class="btn_reply_argument mobile_hidden" [ngClass]="{disabled: !canReply}"
(click)="handleShowReply()" translate="COMPONENTS.ARGUMENT.BTN_REPLY"></button>
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/app/topic/components/argument/argument.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ConfirmDialogComponent } from 'src/app/shared/components/confirm-dialog
import { ArgumentReactionsComponent } from '../argument-reactions/argument-reactions.component';
import { ArgumentReportComponent } from '../argument-report/argument-report.component';
import { TopicMemberUserService } from '@services/topic-member-user.service';
import { AppService } from '@services/app.service';
@Component({
selector: 'argument',
templateUrl: './argument.component.html',
Expand Down Expand Up @@ -39,6 +40,7 @@ export class ArgumentComponent implements OnInit {
public dialog: DialogService,
public config: ConfigService,
public Auth: AuthService,
public App: AppService,
private readonly Location: LocationService,
private readonly Notification: NotificationService,
private readonly Translate: TranslateService,
Expand Down Expand Up @@ -216,4 +218,13 @@ export class ArgumentComponent implements OnInit {
}, 2000);
}
}

handleShowReply() {
const loggedIn = this.Auth.loggedIn$.value;
if (loggedIn) {
this.showReply = !this.showReply;
} else {
this.App.doShowLogin();
}
}
}

0 comments on commit b25deaa

Please sign in to comment.