-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated comments tree - you can add comments
Updated stats - you can upvote/downvote Updated upload - you can upload a post
- Loading branch information
1 parent
16a00bd
commit fc8532a
Showing
10 changed files
with
130 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
src/app/pages/post/components/comment-tree/comment-tree.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import { Component, Input, OnInit } from "@angular/core"; | ||
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; | ||
import { CommentDetail } from "src/app/api/types/comment-detail"; | ||
|
||
@Component({ | ||
selector: "app-comment-tree", | ||
templateUrl: "./comment-tree.component.html", | ||
styleUrls: ["./comment-tree.component.scss"] | ||
styleUrls: ["./comment-tree.component.scss"], | ||
}) | ||
export class CommentTreeComponent implements OnInit { | ||
@Input() comments: CommentDetail[]; | ||
// @Input() depth = 0; | ||
|
||
@Output() addComment: EventEmitter<string> = new EventEmitter<string>(); | ||
|
||
newComment = ""; | ||
constructor() {} | ||
|
||
ngOnInit() {} | ||
|
||
add() { | ||
this.addComment.emit(this.newComment); | ||
this.newComment = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<div> | ||
<ion-button size="{{ size }}" fill="{{ fill }}" | ||
<ion-button size="{{ size }}" fill="{{ fill }}" (click)="upvote()" | ||
>{{ stats.upvotes }} <fa-icon [icon]="['fas', 'arrow-up']"></fa-icon | ||
></ion-button> | ||
<ion-button size="{{ size }}" fill="{{ fill }}" | ||
<ion-button size="{{ size }}" fill="{{ fill }}" (click)="downvote()" | ||
>{{ stats.downvotes }} <fa-icon [icon]="['fas', 'arrow-down']"></fa-icon | ||
></ion-button> | ||
<ion-button size="{{ size }}" fill="{{ fill }}" | ||
<!-- <ion-button size="{{ size }}" fill="{{ fill }}" | ||
><fa-icon [icon]="['fas', 'share-alt-square']"></fa-icon | ||
></ion-button> | ||
></ion-button> --> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters