1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

changed node structure

This commit is contained in:
Fedor Katurov 2019-10-20 18:13:09 +07:00
parent 5d7b76f003
commit 23a38fed60
2 changed files with 6 additions and 11 deletions

View file

@ -12,7 +12,7 @@ interface IProps {
is_text?: boolean;
}
const Cell: FC<IProps> = ({ node: { id, title, brief, type, blocks }, onSelect }) => {
const Cell: FC<IProps> = ({ node: { id, title, thumbnail, type, blocks }, onSelect }) => {
const [is_loaded, setIsLoaded] = useState(false);
const onImageLoad = useCallback(() => {
@ -33,15 +33,15 @@ const Cell: FC<IProps> = ({ node: { id, title, brief, type, blocks }, onSelect }
{text && <div className={styles.text}>{text}</div>}
</div>
{brief && brief.thumbnail && (
{thumbnail && (
<div
className={styles.thumbnail}
style={{
backgroundImage: `url("${getURL({ url: brief.thumbnail })}")`,
backgroundImage: `url("${getURL({ url: thumbnail })}")`,
opacity: is_loaded ? 1 : 0,
}}
>
<img src={getURL({ url: brief.thumbnail })} onLoad={onImageLoad} alt="" />
<img src={getURL({ url: thumbnail })} onLoad={onImageLoad} alt="" />
</div>
)}
</div>

View file

@ -117,13 +117,8 @@ export interface INode {
type: string;
blocks: IBlock[];
brief?: {
thumbnail?: string;
description?: string;
owner?: string;
comments?: number;
};
thumbnail?: string;
description?: string;
options: {
flow: {