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

displaying text

This commit is contained in:
Fedor Katurov 2019-10-17 14:44:13 +07:00
parent 57f90ee46b
commit 54ce8db210
8 changed files with 51 additions and 22 deletions

View file

@ -1,15 +1,4 @@
import React, {
FC,
useMemo,
useState,
useEffect,
RefObject,
LegacyRef,
useRef,
useCallback,
MouseEventHandler,
TouchEventHandler,
} from 'react';
import React, { FC, useMemo, useState, useEffect, useRef, useCallback } from 'react';
import { ImageSwitcher } from '../ImageSwitcher';
import * as styles from './styles.scss';
import { INode } from '~/redux/types';

View file

@ -0,0 +1,20 @@
import React, { FC } from 'react';
import { INode } from '~/redux/types';
import path from 'ramda/es/path';
import { formatCommentText } from '~/utils/dom';
import * as styles from './styles.scss';
interface IProps {
node: INode;
}
const NodeTextBlock: FC<IProps> = ({ node }) => (
<div
className={styles.text}
dangerouslySetInnerHTML={{
__html: formatCommentText(null, path(['blocks', 0, 'text'], node)),
}}
/>
);
export { NodeTextBlock };

View file

@ -0,0 +1,11 @@
.text {
@include outer_shadow();
background: $content_bg;
padding: $gap;
border-radius: $radius;
p {
margin: $gap / 2 0;
}
}