1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed node rendering

This commit is contained in:
Fedor Katurov 2019-11-07 16:51:03 +07:00
parent 47c421dbfa
commit 64409359b3
2 changed files with 4 additions and 4 deletions

View file

@ -77,11 +77,11 @@ const NodeImageSlideBlock: FC<IProps> = ({ node, is_loading, updateLayout }) =>
const { width } = wrap.current.getBoundingClientRect(); const { width } = wrap.current.getBoundingClientRect();
if (is_loading) return setHeight((width * 9) / 16);
const selected = Math.abs(-offset / width); const selected = Math.abs(-offset / width);
if (is_loading) { if (!heights[Math.round(selected)]) return setHeight((width * 9) / 16);
return setHeight((width * 9) / 16);
}
const prev = Math.max(heights[Math.floor(selected)] || 320, 320); const prev = Math.max(heights[Math.floor(selected)] || 320, 320);
const next = Math.max(heights[Math.ceil(selected)] || 320, 320); const next = Math.max(heights[Math.ceil(selected)] || 320, 320);

View file

@ -86,7 +86,7 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
}, [nodeSetCoverImage, node.cover]); }, [nodeSetCoverImage, node.cover]);
return ( return (
<Card className={styles.node} seamless> <Card className={styles.node} seamless key={id}>
{block && createElement(block, { node, is_loading, updateLayout, layout })} {block && createElement(block, { node, is_loading, updateLayout, layout })}
<NodePanel <NodePanel