admin panel changes

This commit is contained in:
Maciek Głowacki
2020-12-12 20:32:09 +01:00
parent e3a1b280e0
commit 54027d1980
6 changed files with 34 additions and 19 deletions

View File

@ -1,4 +1,4 @@
import React, { useEffect, useRef } from 'react';
import React, { useEffect, useLayoutEffect, useRef } from 'react';
import { useState } from 'react';
import { SchedulerEvents } from './SchedulerEvents';
import { days, hours } from '../constants/index';
@ -66,7 +66,7 @@ export const Scheduler = () => {
const [cellWidth, setCellWidth] = useState(0);
const [cellHeight, setCellHeight] = useState(0);
useEffect(() => {
useLayoutEffect(() => {
const handleResize = () => {
if (cellRef.current) {
setCellWidth(cellRef.current.getBoundingClientRect().width);