fix(loading): make sure the default spinner is absolute relative to root always

This commit is contained in:
enes 2024-09-11 13:27:50 +02:00
parent e2b3dc13fb
commit 4bc5882ab6

View File

@ -1,3 +1,4 @@
import { createPortal } from 'react-dom'
import styles from './style.module.scss' import styles from './style.module.scss'
interface Props { interface Props {
@ -20,7 +21,7 @@ export const LoadingSpinner = (props: Props) => {
) )
default: default:
return ( return createPortal(
<div className={styles.loadingSpinnerOverlay}> <div className={styles.loadingSpinnerOverlay}>
<div <div
className={styles.loadingSpinnerContainer} className={styles.loadingSpinnerContainer}
@ -29,7 +30,8 @@ export const LoadingSpinner = (props: Props) => {
<div className={styles.loadingSpinner}></div> <div className={styles.loadingSpinner}></div>
{desc && <p className={styles.loadingSpinnerDesc}>{desc}</p>} {desc && <p className={styles.loadingSpinnerDesc}>{desc}</p>}
</div> </div>
</div> </div>,
document.getElementById('root')!
) )
} }
} }