mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
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:
committed by
GitHub
parent
ce7be1b30c
commit
dad382d2b1
@@ -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>
|
||||
<PostStatusLabel
|
||||
{...postStatuses.find(postStatus => postStatus.id === postUpdate.postStatusId)}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
</p>
|
||||
|
||||
<MutedText>{friendlyDate(postUpdate.updatedAt)}</MutedText>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user