mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 19:57:52 +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
33
app/javascript/components/Post/ActionBox.tsx
Normal file
33
app/javascript/components/Post/ActionBox.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as React from 'react';
|
||||
import Button from '../shared/Button';
|
||||
|
||||
import { BoxTitleText, SmallMutedText } from '../shared/CustomTexts';
|
||||
|
||||
interface Props {
|
||||
followed: boolean;
|
||||
submitFollow(): void;
|
||||
|
||||
isLoggedIn: boolean;
|
||||
}
|
||||
|
||||
const ActionBox = ({followed, submitFollow, isLoggedIn}: Props) => (
|
||||
<div className="actionBoxContainer">
|
||||
<div className="actionBoxFollow">
|
||||
<BoxTitleText>Actions</BoxTitleText>
|
||||
<br />
|
||||
<Button onClick={isLoggedIn ? submitFollow : () => location.href = '/users/sign_in'} outline>
|
||||
{ followed ? 'Unfollow post' : 'Follow post' }
|
||||
</Button>
|
||||
<br />
|
||||
<SmallMutedText>
|
||||
{ followed ?
|
||||
'you\'re receiving notifications about new updates on this post'
|
||||
:
|
||||
'you won\'t receive notifications about this post'
|
||||
}
|
||||
</SmallMutedText>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default ActionBox;
|
||||
Reference in New Issue
Block a user