* change root dit and change way to import modules * update deps to latest versions * use latest tools for building bundles * rewrite webpack config * use nomodule technique for loading modern bundle * inject polyfills by babel usebuiltins * update eslint rules * rename all style files to CSS * use postcss preset env for building styles * proper typescript typing * put all html files to templates folder * etc
11 lines
355 B
TypeScript
11 lines
355 B
TypeScript
import { Comment, CommentMode } from '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;
|
|
};
|