mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
floating node panel
This commit is contained in:
parent
9e25b4e2b0
commit
336582b3d6
7 changed files with 200 additions and 113 deletions
|
@ -18,9 +18,11 @@ import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
|||
interface IProps {
|
||||
is_loading: boolean;
|
||||
node: INode;
|
||||
layout: {};
|
||||
updateLayout: () => void;
|
||||
}
|
||||
|
||||
const NodeImageBlock: FC<IProps> = ({ node, is_loading }) => {
|
||||
const NodeImageBlock: FC<IProps> = ({ node, is_loading, updateLayout }) => {
|
||||
const [is_animated, setIsAnimated] = useState(false);
|
||||
const [current, setCurrent] = useState(0);
|
||||
const [height, setHeight] = useState(320);
|
||||
|
@ -39,6 +41,8 @@ const NodeImageBlock: FC<IProps> = ({ node, is_loading }) => {
|
|||
loaded,
|
||||
]);
|
||||
|
||||
useEffect(() => updateLayout(), [loaded]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!refs || !refs.current[current] || !loaded[current]) return setHeight(320);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue