mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
displaying text
This commit is contained in:
parent
57f90ee46b
commit
54ce8db210
8 changed files with 51 additions and 22 deletions
|
@ -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';
|
||||
|
|
20
src/components/node/NodeTextBlock/index.tsx
Normal file
20
src/components/node/NodeTextBlock/index.tsx
Normal 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 };
|
11
src/components/node/NodeTextBlock/styles.scss
Normal file
11
src/components/node/NodeTextBlock/styles.scss
Normal file
|
@ -0,0 +1,11 @@
|
|||
.text {
|
||||
@include outer_shadow();
|
||||
|
||||
background: $content_bg;
|
||||
padding: $gap;
|
||||
border-radius: $radius;
|
||||
|
||||
p {
|
||||
margin: $gap / 2 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue