1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed lab node click handlers with hooks

This commit is contained in:
Fedor Katurov 2021-03-31 14:43:01 +07:00
parent 1db5c64d06
commit d865067eaf
6 changed files with 26 additions and 18 deletions

View file

@ -3,8 +3,11 @@ import { INodeComponentProps } from '~/redux/node/constants';
import styles from './styles.module.scss';
import { Markdown } from '~/components/containers/Markdown';
import { formatText } from '~/utils/dom';
import { useGotoNode } from '~/utils/hooks/node/useGotoNode';
const LabDescription: FC<INodeComponentProps> = ({ node }) => {
const onClick = useGotoNode(node.id);
if (!node.description) {
return null;
}
@ -13,6 +16,7 @@ const LabDescription: FC<INodeComponentProps> = ({ node }) => {
<Markdown
className={styles.wrap}
dangerouslySetInnerHTML={{ __html: formatText(node.description) }}
onClick={onClick}
/>
);
};