mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
displaying cells
This commit is contained in:
parent
09b4fbd7b6
commit
b844e58568
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, useState, useCallback } from 'react';
|
||||
import { INode } from '~/redux/types';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { getImageSize } from '~/utils/dom';
|
||||
import { getImageSize, getURL } from '~/utils/dom';
|
||||
import classNames = require('classnames');
|
||||
|
||||
import * as styles from './styles.scss';
|
||||
|
@ -37,11 +37,11 @@ const Cell: FC<IProps> = ({ node: { id, title, brief, type }, onSelect, is_text
|
|||
<div
|
||||
className={styles.thumbnail}
|
||||
style={{
|
||||
backgroundImage: `url("${brief.thumbnail}")`,
|
||||
backgroundImage: `url("${getURL({ url: brief.thumbnail })}")`,
|
||||
opacity: is_loaded ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<img src={brief.thumbnail} onLoad={onImageLoad} alt="" />
|
||||
<img src={getURL({ url: brief.thumbnail })} onLoad={onImageLoad} alt="" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -54,7 +54,7 @@ export const describeArc = (
|
|||
].join(' ');
|
||||
};
|
||||
|
||||
export const getURL = (file: IFile) => {
|
||||
export const getURL = (file: Partial<IFile>) => {
|
||||
if (!file || !file.url) return null;
|
||||
|
||||
return file.url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue