diff --git a/src/app/pipe/dateTimeFormat.pipe.ts b/src/app/pipe/dateTimeFormat.pipe.ts new file mode 100644 index 0000000..aae77b2 --- /dev/null +++ b/src/app/pipe/dateTimeFormat.pipe.ts @@ -0,0 +1,15 @@ +import { inject, Pipe, PipeTransform } from '@angular/core'; +import { DateService } from '../service/date.service'; + +@Pipe({ + name: 'dateTimeFormat' +}) +export class DateTimeFormatPipe implements PipeTransform { + + private readonly dateService = inject(DateService); + + public transform(raw: string): string { + return this.dateService.format(raw); + } + +} diff --git a/src/app/recipe-comments-list/recipe-comments-list.component.css b/src/app/recipe-comments-list/recipe-comments-list.component.css index e69de29..f70ed90 100644 --- a/src/app/recipe-comments-list/recipe-comments-list.component.css +++ b/src/app/recipe-comments-list/recipe-comments-list.component.css @@ -0,0 +1,49 @@ +#add-comment-form { + display: flex; + flex-direction: column; + align-items: flex-start; + row-gap: 10px; +} + +#add-comment-form > textarea { + width: 80ch; + height: 100px; + padding: 10px; + font-size: 16px; +} + +#comments { + display: flex; + flex-direction: column; + row-gap: 10px; + margin: 0; + padding: 0; +} + +#comments > li:not(:last-child) { + border-bottom: 1px solid var(--off-white-5); +} + +.comment { + display: flex; + flex-direction: column; +} + +.comment-username-time { + display: flex; + align-items: center; + column-gap: 10px; +} + +.comment-username { + font-weight: bold; + font-size: 1.25em; +} + +.comment-time { + opacity: 0.75; +} + +.comment-text { + padding-bottom: 10px; +} diff --git a/src/app/recipe-comments-list/recipe-comments-list.component.html b/src/app/recipe-comments-list/recipe-comments-list.component.html index 0a40a11..7b79ca5 100644 --- a/src/app/recipe-comments-list/recipe-comments-list.component.html +++ b/src/app/recipe-comments-list/recipe-comments-list.component.html @@ -3,10 +3,8 @@ @if (isLoggedIn()) {

Add Comment

-
- - - + +
@@ -19,18 +17,23 @@ } @else if (commentsQuery.isError()) {

There was an error loading the comments.

} @else { -