feat: 💨
This commit is contained in:
parent
5fe2dc619a
commit
897a343936
1 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import storage from '@/services/local-storage.service'
|
import storage from '@/services/local-storage.service'
|
||||||
import { TNotificationStyle } from '@/types'
|
import { TNotificationStyle } from '@/types'
|
||||||
import { createContext, useContext, useState } from 'react'
|
import { createContext, useContext, useEffect, useState } from 'react'
|
||||||
import { useScreenSize } from './ScreenSizeProvider'
|
import { useScreenSize } from './ScreenSizeProvider'
|
||||||
|
|
||||||
type TUserPreferencesContext = {
|
type TUserPreferencesContext = {
|
||||||
|
|
@ -38,6 +38,14 @@ export function UserPreferencesProvider({ children }: { children: React.ReactNod
|
||||||
storage.getEnableSingleColumnLayout()
|
storage.getEnableSingleColumnLayout()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isSmallScreen && enableSingleColumnLayout) {
|
||||||
|
document.documentElement.style.setProperty('overflow-y', 'scroll')
|
||||||
|
} else {
|
||||||
|
document.documentElement.style.removeProperty('overflow-y')
|
||||||
|
}
|
||||||
|
}, [enableSingleColumnLayout, isSmallScreen])
|
||||||
|
|
||||||
const updateNotificationListStyle = (style: TNotificationStyle) => {
|
const updateNotificationListStyle = (style: TNotificationStyle) => {
|
||||||
setNotificationListStyle(style)
|
setNotificationListStyle(style)
|
||||||
storage.setNotificationListStyle(style)
|
storage.setNotificationListStyle(style)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue