mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
displaying image nodes
This commit is contained in:
parent
c6ccbb0fb4
commit
09b4fbd7b6
3 changed files with 7 additions and 8 deletions
|
@ -1,5 +1,4 @@
|
|||
import React, { FC, useState, useCallback } from 'react';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { INode } from '~/redux/types';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { getImageSize } from '~/utils/dom';
|
||||
|
@ -38,11 +37,11 @@ const Cell: FC<IProps> = ({ node: { id, title, brief, type }, onSelect, is_text
|
|||
<div
|
||||
className={styles.thumbnail}
|
||||
style={{
|
||||
backgroundImage: `url("${getImageSize(brief.thumbnail, 'medium')}")`,
|
||||
backgroundImage: `url("${brief.thumbnail}")`,
|
||||
opacity: is_loaded ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<img src={getImageSize(brief.thumbnail, 'medium')} onLoad={onImageLoad} alt="" />
|
||||
<img src={brief.thumbnail} onLoad={onImageLoad} alt="" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue