mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
changed node structure
This commit is contained in:
parent
5d7b76f003
commit
23a38fed60
2 changed files with 6 additions and 11 deletions
|
@ -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>
|
||||
|
|
|
@ -117,13 +117,8 @@ export interface INode {
|
|||
type: string;
|
||||
|
||||
blocks: IBlock[];
|
||||
|
||||
brief?: {
|
||||
thumbnail?: string;
|
||||
description?: string;
|
||||
owner?: string;
|
||||
comments?: number;
|
||||
};
|
||||
|
||||
options: {
|
||||
flow: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue