feat: improve single-column layout
This commit is contained in:
parent
1674671d7f
commit
936b15e5c2
13 changed files with 316 additions and 231 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import storage from '@/services/local-storage.service'
|
||||
import { TNotificationStyle } from '@/types'
|
||||
import { createContext, useContext, useState } from 'react'
|
||||
import { useScreenSize } from './ScreenSizeProvider'
|
||||
|
||||
type TUserPreferencesContext = {
|
||||
notificationListStyle: TNotificationStyle
|
||||
|
|
@ -27,6 +28,7 @@ export const useUserPreferences = () => {
|
|||
}
|
||||
|
||||
export function UserPreferencesProvider({ children }: { children: React.ReactNode }) {
|
||||
const { isSmallScreen } = useScreenSize()
|
||||
const [notificationListStyle, setNotificationListStyle] = useState(
|
||||
storage.getNotificationListStyle()
|
||||
)
|
||||
|
|
@ -60,7 +62,7 @@ export function UserPreferencesProvider({ children }: { children: React.ReactNod
|
|||
updateMuteMedia: setMuteMedia,
|
||||
sidebarCollapse,
|
||||
updateSidebarCollapse,
|
||||
enableSingleColumnLayout,
|
||||
enableSingleColumnLayout: isSmallScreen ? true : enableSingleColumnLayout,
|
||||
updateEnableSingleColumnLayout
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue