diff --git a/package-lock.json b/package-lock.json index 546810d..da5a211 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7567,6 +7567,11 @@ "minimist": "^1.2.5" } }, + "moment": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", + "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==" + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", diff --git a/package.json b/package.json index 68cf7c3..e26c57d 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@angular/router": "~9.1.1", "@angular/service-worker": "~9.1.1", "angular-svg-icon": "^9.2.0", + "moment": "^2.27.0", "ngx-scroll-event": "^1.0.8", "ngx-siema": "^2.0.1", "rxjs": "~6.5.4", diff --git a/src/app/reusable-components/forum/forum.component.html b/src/app/reusable-components/forum/forum.component.html index bc97114..bc6f71f 100644 --- a/src/app/reusable-components/forum/forum.component.html +++ b/src/app/reusable-components/forum/forum.component.html @@ -12,7 +12,7 @@
- +
@@ -26,98 +26,60 @@ + +
+
+

More Options

+ +
+ +
diff --git a/src/app/reusable-components/forum/forum.component.scss b/src/app/reusable-components/forum/forum.component.scss index 51eee60..f191cc4 100644 --- a/src/app/reusable-components/forum/forum.component.scss +++ b/src/app/reusable-components/forum/forum.component.scss @@ -1,28 +1,33 @@ -.forum-details { - .add-post { - width: 90%; - margin: 10px auto 20px; - .post-input { - border: 0px; - height: 150px; - display: block; - width: 100%; - font-size: 16px; - color: white; - padding: 10px; - background-color: transparent; - border: 2px solid var(--dark-grey); - border-radius: 7px; - resize: none; - margin: 20px auto; +.add-post { + width: 90%; + margin: 10px auto 20px; + .post-input { + border: 0px; + height: 150px; + display: block; + width: 100%; + font-size: 16px; + color: white; + padding: 10px; + background-color: transparent; + border: 2px solid var(--dark-grey); + border-radius: 7px; + resize: none; + margin: 20px auto; - &::placeholder { - opacity: 0.8; - font-weight: 400; - } + &::placeholder { + opacity: 0.8; + font-weight: 400; } } + .action-buttons { + display: flex; + width: 100%; + margin-top: 20px; + justify-content: space-between; + } + .input-holder { display: flex; align-items: center; @@ -62,13 +67,6 @@ } } - .action-buttons { - display: flex; - width: 100%; - margin-top: 20px; - justify-content: space-between; - } - .add-post-button { display: block; flex-grow: 1; @@ -198,13 +196,6 @@ &.active { box-shadow: 0px 0px 5px var(--teal-green); - .action-buttons { - button { - border: 1px solid var(--light-grey); - border-radius: 5px; - } - } - p { display: block; max-height: none; @@ -215,6 +206,21 @@ } } + .tags { + width: 100%; + + button { + background-color: var(--black); + color: white; + border-radius: 20px; + height: 25px; + font-size: 12px; + padding: 0 15px; + border: 0px; + margin-right: 5px; + } + } + .book-mark-button { position: absolute; right: 10px; @@ -222,9 +228,15 @@ border: 0px; background-color: transparent; + &.active { + .icon { + fill: var(--teal); + } + } + .icon { - width: 20px; - height: 20px; + width: 15px; + height: 15px; fill: var(--light-grey); } } @@ -291,19 +303,28 @@ button { background-color: transparent; - color: var(--light-grey); - border: 0px; + color: var(--light-grey); padding: 0 10px; height: 30px; margin-right: 10px; display: flex; align-items: center; justify-content: center; + border: 1px solid var(--light-grey); + border-radius: 5px; + + &.active { + color: var(--teal-green); + + .icon { + fill: var(--teal-green); + } + } .icon { width: 15px; height: 15px; - margin-right: 2px; + margin-right: 5px; fill: var(--light-grey); } @@ -383,5 +404,11 @@ display: block; max-height: none; } + + &.reply-comment { + margin-top: 10px; + padding-left: 15px; + border-left: 3px solid var(--light-grey); + } } } diff --git a/src/app/reusable-components/forum/forum.component.ts b/src/app/reusable-components/forum/forum.component.ts index 5bfd49c..ec15373 100644 --- a/src/app/reusable-components/forum/forum.component.ts +++ b/src/app/reusable-components/forum/forum.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; +import * as moment from 'moment'; @Component({ selector: 'app-forum', @@ -14,10 +15,93 @@ export class ForumComponent implements OnInit { @Input() isSubSegment: boolean = false; + forumPostList = [{ + question: 'Can anyone tell me how to find Planck\'s constant', + isBookmarked: false, + isLiked: true, + likeCount: 30, + hashTags: ['h', 'maxplank', 'quantum physics'], + friendTags: ['Rahul'], + helpLink: 'https://en.wikipedia.org/wiki/Planck_constant', + files: [], + author: { + name: 'Mr Miyagi', + imgSrc: 'https://pbs.twimg.com/profile_images/673997632969117696/6Fm92vaZ_400x400.jpg' + }, + date: new Date(), + answers: [{ + answer: 'Here is a video you can take a look at if you would like to understand more...', + isBookmarked: true, + isLiked: false, + likeCount: 10, + friendTags: ['Mr Miyagi'], + helpLink: 'https://www.youtube.com/watch?v=tQSbms5MDvY', + files: [], + author: { + name: 'Rahul', + imgSrc: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' + }, + date: new Date(), + comments: [{ + description: 'Are you Sure Rahul?', + isLiked: true, + likeCount: 1, + author: { + name: 'Mr Miyagi', + imgSrc: 'https://pbs.twimg.com/profile_images/673997632969117696/6Fm92vaZ_400x400.jpg' + }, + date: new Date(), + replyComment: [{ + description: 'Yes Bro!', + isLiked: false, + likeCount: 0, + author: { + name: 'Rahul', + imgSrc: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' + }, + date: new Date(), + }] + }] + }] + }, { + question: 'How to define "What is a cricle?" question?', + isBookmarked: true, + isLiked: false, + likeCount: 30, + hashTags: ['maths', 'circle'], + friendTags: [], + helpLink: '', + files: [], + author: { + name: 'Mr Miyagi', + imgSrc: 'https://pbs.twimg.com/profile_images/673997632969117696/6Fm92vaZ_400x400.jpg' + }, + date: new Date(), + answers: [{ + answer: 'Here is a video you can take a look at if you would like to understand more...', + isBookmarked: true, + isLiked: false, + likeCount: 10, + friendTags: ['Mr Miyagi'], + helpLink: 'https://www.youtube.com/watch?v=tQSbms5MDvY', + files: [], + author: { + name: 'Rahul', + imgSrc: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg' + }, + date: new Date(), + comments: [] + }] + }]; + constructor() { } ngOnInit(): void { } + getFormattedDate(date: any) { + return moment(date).format('MMMM DD, YYYY'); + } + } diff --git a/src/app/reusable-components/forum/post-details/post-details.component.html b/src/app/reusable-components/forum/post-details/post-details.component.html index bbd6ebc..5924b62 100644 --- a/src/app/reusable-components/forum/post-details/post-details.component.html +++ b/src/app/reusable-components/forum/post-details/post-details.component.html @@ -36,7 +36,7 @@ August 15, 2020
- @@ -70,7 +70,7 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio!

- @@ -79,10 +79,31 @@ 56 -
+ +
+
+ + + August 15, 2020 +
+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio! +

+
+ + + +
+
  • @@ -95,16 +116,16 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio!

    - -
    @@ -132,7 +153,7 @@ August 15, 2020
  • - @@ -166,7 +187,7 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio!

    - @@ -175,7 +196,7 @@ 56 -
    @@ -191,16 +212,16 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio!

    - -
    @@ -261,7 +282,7 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio!

    - @@ -270,7 +291,7 @@ 56 -
    @@ -286,16 +307,16 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, iusto, quaerat. Facilis commodi, pariatur eum. Nam ullam neque delectus, ducimus! Odit, qui ad vitae. Rerum vero quisquam laboriosam, accusantium optio!

    - -