1
0
Fork 0
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:
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; 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 [is_loaded, setIsLoaded] = useState(false);
const onImageLoad = useCallback(() => { 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>} {text && <div className={styles.text}>{text}</div>}
</div> </div>
{brief && brief.thumbnail && ( {thumbnail && (
<div <div
className={styles.thumbnail} className={styles.thumbnail}
style={{ style={{
backgroundImage: `url("${getURL({ url: brief.thumbnail })}")`, backgroundImage: `url("${getURL({ url: thumbnail })}")`,
opacity: is_loaded ? 1 : 0, opacity: is_loaded ? 1 : 0,
}} }}
> >
<img src={getURL({ url: brief.thumbnail })} onLoad={onImageLoad} alt="" /> <img src={getURL({ url: thumbnail })} onLoad={onImageLoad} alt="" />
</div> </div>
)} )}
</div> </div>

View file

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