mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
made comment block props type
This commit is contained in:
parent
c8d8aa356e
commit
b8c15cfd99
4 changed files with 9 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
import React, { FC, memo, useMemo, useEffect } from 'react';
|
import React, { FC, memo, useMemo, useEffect } from 'react';
|
||||||
import { ICommentBlock } from '~/constants/comment';
|
import { ICommentBlockProps } from '~/constants/comment';
|
||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
import { getYoutubeThumb } from '~/utils/dom';
|
import { getYoutubeThumb } from '~/utils/dom';
|
||||||
import { selectPlayer } from '~/redux/player/selectors';
|
import { selectPlayer } from '~/redux/player/selectors';
|
||||||
|
@ -16,9 +16,8 @@ const mapDispatchToProps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = ReturnType<typeof mapStateToProps> &
|
type Props = ReturnType<typeof mapStateToProps> &
|
||||||
typeof mapDispatchToProps & {
|
typeof mapDispatchToProps &
|
||||||
block: ICommentBlock;
|
ICommentBlockProps & {};
|
||||||
};
|
|
||||||
|
|
||||||
const CommentEmbedBlockUnconnected: FC<Props> = memo(
|
const CommentEmbedBlockUnconnected: FC<Props> = memo(
|
||||||
({ block, youtubes, playerGetYoutubeInfo }) => {
|
({ block, youtubes, playerGetYoutubeInfo }) => {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
import { ICommentBlock } from '~/constants/comment';
|
import { ICommentBlockProps } from '~/constants/comment';
|
||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps extends ICommentBlockProps {}
|
||||||
block: ICommentBlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CommentTextBlock: FC<IProps> = ({ block }) => {
|
const CommentTextBlock: FC<IProps> = ({ block }) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { AudioPlayer } from '~/components/media/AudioPlayer';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { PRESETS } from '~/constants/urls';
|
import { PRESETS } from '~/constants/urls';
|
||||||
import { COMMENT_BLOCK_RENDERERS } from '~/constants/comment';
|
import { COMMENT_BLOCK_RENDERERS } from '~/constants/comment';
|
||||||
import { Icon } from '~/components/input/Icon';
|
|
||||||
import { nodeLockComment, nodeEditComment } from '~/redux/node/actions';
|
import { nodeLockComment, nodeEditComment } from '~/redux/node/actions';
|
||||||
import { CommentMenu } from '../CommentMenu';
|
import { CommentMenu } from '../CommentMenu';
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,10 @@ export type ICommentBlock = {
|
||||||
content: string;
|
content: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ICommentBlockProps = {
|
||||||
|
block: ICommentBlock;
|
||||||
|
};
|
||||||
|
|
||||||
export const COMMENT_BLOCK_RENDERERS = {
|
export const COMMENT_BLOCK_RENDERERS = {
|
||||||
[COMMENT_BLOCK_TYPES.TEXT]: CommentTextBlock,
|
[COMMENT_BLOCK_TYPES.TEXT]: CommentTextBlock,
|
||||||
[COMMENT_BLOCK_TYPES.MARK]: CommentTextBlock,
|
[COMMENT_BLOCK_TYPES.MARK]: CommentTextBlock,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue