Post follow and updates notifications V1 (#111)

* It is now possible to follow a post in order to receive updates about it
* Notifications are now sent when updates are published
* Post status changes are now tracked
* Update sidebar now shows the post status history
* Mark a comment as a post update using the comment form
* ... more ...
This commit is contained in:
Riccardo Graziosi
2022-05-28 11:03:36 +02:00
committed by GitHub
parent ce7be1b30c
commit dad382d2b1
59 changed files with 1080 additions and 71 deletions

View File

@@ -5,17 +5,22 @@ import { BoxTitleText, DangerText, CenteredMutedText, MutedText } from '../share
import Spinner from '../shared/Spinner';
import IComment from '../../interfaces/IComment';
import IPostStatusChange from '../../interfaces/IPostStatusChange';
import IPostStatus from '../../interfaces/IPostStatus';
import friendlyDate from '../../helpers/friendlyDate';
import friendlyDate from '../../helpers/datetime';
import PostStatusLabel from '../shared/PostStatusLabel';
interface Props {
postUpdates: Array<IComment>;
postUpdates: Array<IComment | IPostStatusChange>;
postStatuses: Array<IPostStatus>
areLoading: boolean;
error: string;
}
const PostUpdateList = ({
postUpdates,
postStatuses,
areLoading,
error,
}: Props) => (
@@ -33,7 +38,18 @@ const PostUpdateList = ({
<span>{postUpdate.userFullName}</span>
</div>
<p className="postUpdateListItemBody">{postUpdate.body}</p>
<p className="postUpdateListItemBody">
{ 'body' in postUpdate ?
postUpdate.body
:
<React.Fragment>
<i>changed status to</i>&nbsp;
<PostStatusLabel
{...postStatuses.find(postStatus => postStatus.id === postUpdate.postStatusId)}
/>
</React.Fragment>
}
</p>
<MutedText>{friendlyDate(postUpdate.updatedAt)}</MutedText>
</div>