The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/setupWizard/hooks/useBodyPosition.ts

16 lines
360 B

import { useEffect } from 'react';
export const useBodyPosition = (position: string, enabled = true): void => {
useEffect(() => {
if (!enabled) {
return;
}
const previous = document.body.style.position;
document.body.style.position = position;
return (): void => {
document.body.style.position = previous;
};
}, [position, enabled]);
};