mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
27 lines
729 B
TypeScript
27 lines
729 B
TypeScript
export const TOGGLE_COMMENT_REPLY = 'TOGGLE_COMMENT_REPLY';
|
|
interface ToggleCommentReplyAction {
|
|
type: typeof TOGGLE_COMMENT_REPLY;
|
|
commentId: number;
|
|
}
|
|
|
|
export const SET_COMMENT_REPLY_BODY = 'SET_COMMENT_REPLY_BODY';
|
|
interface SetCommentReplyBodyAction {
|
|
type: typeof SET_COMMENT_REPLY_BODY;
|
|
commentId: number;
|
|
body: string;
|
|
}
|
|
|
|
export const toggleCommentReply = (commentId: number): ToggleCommentReplyAction => ({
|
|
type: TOGGLE_COMMENT_REPLY,
|
|
commentId,
|
|
});
|
|
|
|
export const setCommentReplyBody = (commentId: number, body: string): SetCommentReplyBodyAction => ({
|
|
type: SET_COMMENT_REPLY_BODY,
|
|
commentId,
|
|
body,
|
|
});
|
|
|
|
export type HandleCommentRepliesType =
|
|
ToggleCommentReplyAction |
|
|
SetCommentReplyBodyAction; |