mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
comment rendering
This commit is contained in:
parent
398f44e232
commit
9531edcd19
10 changed files with 83 additions and 37 deletions
|
@ -21,6 +21,7 @@ interface IProps {
|
|||
}
|
||||
|
||||
const NodeImageBlock: FC<IProps> = ({ node, is_loading }) => {
|
||||
const [is_animated, setIsAnimated] = useState(false);
|
||||
const [current, setCurrent] = useState(0);
|
||||
const [height, setHeight] = useState(320);
|
||||
const [loaded, setLoaded] = useState<Record<number, boolean>>({});
|
||||
|
@ -48,8 +49,14 @@ const NodeImageBlock: FC<IProps> = ({ node, is_loading }) => {
|
|||
setHeight(element_height);
|
||||
}, [refs, current, loaded]);
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => setIsAnimated(true), 250);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={classNames(styles.wrap, { is_loading })}>
|
||||
<div className={classNames(styles.wrap, { is_loading, is_animated })}>
|
||||
<div>
|
||||
<ImageSwitcher
|
||||
total={images.length}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue