| | |
| | | const intl = useIntl(); |
| | | const { styles } = useStyles(); |
| | | const refContainer = useRef(); |
| | | const [loading, setLoading] = React.useState(true); |
| | | const [loading, setLoading] = React.useState(false); |
| | | |
| | | useEffect(() => { |
| | | console.log(props); |
| | | setTimeout(() => { |
| | | setLoading(false); |
| | | const startThree = () => { |
| | | shelfThree = new ShelfThree(refContainer.current); |
| | | shelfThree.startup(); |
| | | }, 1000) |
| | | |
| | | return () => { |
| | | shelfThree?.destroy(); |
| | | } |
| | | }, [props]); |
| | | |
| | | const endThree = () => { |
| | | if (shelfThree) { |
| | | shelfThree.destroy(); |
| | | shelfThree = null; |
| | | } |
| | | } |
| | | |
| | | useEffect(() => { |
| | | setLoading(true); |
| | | endThree(); |
| | | setTimeout(() => { |
| | | setLoading(false); |
| | | startThree(); |
| | | }, 300) |
| | | |
| | | return endThree; |
| | | }, [props.data.uuid]); |
| | | |
| | | return ( |
| | | <> |