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

fixed node loading

This commit is contained in:
Fedor Katurov 2019-11-07 14:13:46 +07:00
parent cf16cbf0f9
commit d06593b4cb
3 changed files with 32 additions and 7 deletions

View file

@ -7,6 +7,7 @@ import { UPLOAD_TYPES } from '~/redux/uploads/constants';
import { NODE_SETTINGS } from '~/redux/node/constants';
import { getURL } from '~/utils/dom';
import { PRESETS } from '~/constants/urls';
import { LoaderCircle } from '~/components/input/LoaderCircle';
interface IProps {
is_loading: boolean;
@ -174,6 +175,16 @@ const NodeImageSlideBlock: FC<IProps> = ({ node, is_loading, updateLayout }) =>
[wrap]
);
if (is_loading) {
return (
<div className={styles.placeholder}>
<div>
<LoaderCircle size={96} />
</div>
</div>
);
}
return (
<div className={classNames(styles.wrap, { is_loading })} ref={wrap}>
<ImageSwitcher
@ -195,8 +206,6 @@ const NodeImageSlideBlock: FC<IProps> = ({ node, is_loading, updateLayout }) =>
onTouchStart={startDragging}
ref={slide}
>
{(is_loading || !loaded[0] || !images.length) && <div className={styles.placeholder} />}
{images.map((file, index) => (
<div
className={classNames(styles.image_wrap, {