1 import { useLayoutEffect } from 'react';
3 import { useUserSettings } from '@proton/account/userSettings/hooks';
4 import { DENSITY } from '@proton/shared/lib/constants';
6 const { COMPACT, COMFORTABLE } = DENSITY;
9 [COMPACT]: 'is-compact',
10 [COMFORTABLE]: 'is-comfortable',
13 const DensityInjector = () => {
14 const [{ Density } = { Density: COMFORTABLE }] = useUserSettings();
16 useLayoutEffect(() => {
17 document.body.classList.add(CLASSES[Density]);
19 document.body.classList.remove(CLASSES[Density]);
26 export default DensityInjector;