* auth block was moved to comment form * if comments on page read only auth form shows in old place * comment value in form will be saved between refreshes (it is side effect form saving comment value between unauth and auth states)
11 lines
360 B
TypeScript
11 lines
360 B
TypeScript
import { Comment, CommentMode } from '@app/common/types';
|
|
import { StoreState } from '../index';
|
|
|
|
export const getCommentMode = (id: Comment['id']) => (state: StoreState): CommentMode => {
|
|
if (state.comments.activeComment === null || state.comments.activeComment.id !== id) {
|
|
return CommentMode.None;
|
|
}
|
|
|
|
return state.comments.activeComment.state;
|
|
};
|