2024-10-03 10:08:52: merge [main:a841d534925183f00d466928c8bb7a6b16f4b08b];
This commit is contained in:
1 parent
63fa6bc2ab
commit
3e52a14c0a
10 files changed
+87
-63
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { ConfigProvider } from 'antd'
|
||||
import ruRu from 'antd/locale/ru_RU'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
import { darkTheme, lightTheme } from '@constants/theme.ts'
|
||||
|
||||
@@ -18,6 +19,15 @@ const App = () => {
|
||||
: true
|
||||
)
|
||||
|
||||
const location = useLocation()
|
||||
|
||||
useEffect(() => {
|
||||
const prevRoute = sessionStorage.getItem('prevRoute')
|
||||
if (location.pathname !== prevRoute) {
|
||||
sessionStorage.setItem('prevRoute', location.pathname)
|
||||
}
|
||||
}, [location])
|
||||
|
||||
useEffect(() => {
|
||||
setTheme(() => (changeTheme ? darkTheme : lightTheme))
|
||||
}, [changeTheme])
|
||||
|
||||
Reference in new issue
Block a user