fix: access localStorage

This commit is contained in:
DIYgod
2023-09-21 22:19:47 +08:00
parent 316814adb7
commit 661fc36836
3 changed files with 33 additions and 31 deletions
+4 -4
View File
@@ -63,7 +63,7 @@
"@supercharge/request-ip": "1.2.0",
"@tanstack/react-query": "4.35.3",
"@tanstack/react-query-devtools": "4.35.3",
"@uiw/codemirror-extensions-events": "4.21.15",
"@uiw/codemirror-extensions-events": "4.21.16",
"@urql/core": "4.1.3",
"ahooks": "3.7.8",
"aplayer": "^1.10.1",
@@ -72,7 +72,7 @@
"cheerio": "1.0.0-rc.12",
"chroma-js": "2.4.2",
"clsx": "2.0.0",
"crossbell": "1.6.4",
"crossbell": "1.7.2",
"dayjs": "1.11.10",
"dotenv": "16.3.1",
"emoji-mart": "5.5.2",
@@ -110,7 +110,7 @@
"rc-dplayer": "1.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.46.1",
"react-hook-form": "7.46.2",
"react-hot-toast": "2.4.1",
"react-i18next": "13.2.2",
"react-parallax-tilt": "1.7.167",
@@ -144,7 +144,7 @@
"serialize-javascript": "6.0.1",
"sharp": "0.32.6",
"sortablejs": "1.15.0",
"swiper": "^10.2.0",
"swiper": "^10.3.0",
"tailwind-merge": "1.14.0",
"tailwind-scrollbar-hide": "1.1.7",
"tailwindcss-animate": "1.0.7",
+23 -23
View File
@@ -105,8 +105,8 @@ dependencies:
specifier: 4.35.3
version: 4.35.3(@tanstack/react-query@4.35.3)(react-dom@18.2.0)(react@18.2.0)
'@uiw/codemirror-extensions-events':
specifier: 4.21.15
version: 4.21.15(@codemirror/view@6.20.0)
specifier: 4.21.16
version: 4.21.16(@codemirror/view@6.20.0)
'@urql/core':
specifier: 4.1.3
version: 4.1.3
@@ -132,8 +132,8 @@ dependencies:
specifier: 2.0.0
version: 2.0.0
crossbell:
specifier: 1.6.4
version: 1.6.4(typescript@5.2.2)(zod@3.22.2)
specifier: 1.7.2
version: 1.7.2(typescript@5.2.2)(zod@3.22.2)
dayjs:
specifier: 1.11.10
version: 1.11.10
@@ -246,8 +246,8 @@ dependencies:
specifier: 18.2.0
version: 18.2.0(react@18.2.0)
react-hook-form:
specifier: 7.46.1
version: 7.46.1(react@18.2.0)
specifier: 7.46.2
version: 7.46.2(react@18.2.0)
react-hot-toast:
specifier: 2.4.1
version: 2.4.1(csstype@3.1.2)(react-dom@18.2.0)(react@18.2.0)
@@ -348,8 +348,8 @@ dependencies:
specifier: 1.15.0
version: 1.15.0
swiper:
specifier: ^10.2.0
version: 10.2.0
specifier: ^10.3.0
version: 10.3.0
tailwind-merge:
specifier: 1.14.0
version: 1.14.0
@@ -1277,7 +1277,7 @@ packages:
canvas-confetti: 1.6.0
check-password-strength: 2.0.7
classnames: 2.3.2
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
embla-carousel-react: 7.1.0(react@18.2.0)
immer: 10.0.2
lodash.compact: 3.0.1
@@ -1313,7 +1313,7 @@ packages:
react: ^18
dependencies:
'@crossbell/util-hooks': 1.5.13(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
react: 18.2.0
viem: 1.11.1(typescript@5.2.2)(zod@3.22.2)
transitivePeerDependencies:
@@ -1329,7 +1329,7 @@ packages:
resolution: {integrity: sha512-L3yMY1NevNxWP5yBPCyXJgWIZzijjge7KkGF6hDra98qjle0rY1vmzX5fP+hdaN9yHZ/hkgQEf8cEPiXFtM+OQ==}
dependencies:
'@tanstack/react-query': 4.35.3(react-dom@18.2.0)(react@18.2.0)
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
dayjs: 1.11.10
lodash.compact: 3.0.1
lru-cache: 10.0.1
@@ -1391,7 +1391,7 @@ packages:
'@crossbell/util-metadata': 1.5.13(typescript@5.2.2)(zod@3.22.2)
'@tanstack/react-query': 4.35.3(react-dom@18.2.0)(react@18.2.0)
check-password-strength: 2.0.7
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
immer: 10.0.2
lodash.debounce: 4.0.8
react: 18.2.0
@@ -1420,7 +1420,7 @@ packages:
'@crossbell/util-metadata': 1.5.13(typescript@5.2.2)(zod@3.22.2)
'@tanstack/react-query': 4.35.3(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
facepaint: 1.2.1
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
@@ -1447,7 +1447,7 @@ packages:
react: ^18
dependencies:
'@tanstack/react-query': 4.35.3(react-dom@18.2.0)(react@18.2.0)
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
react: 18.2.0
transitivePeerDependencies:
- bufferutil
@@ -1463,7 +1463,7 @@ packages:
dependencies:
'@crossbell/util-ethers': 1.5.13
'@fastify/deepmerge': 1.3.0
crossbell: 1.6.4(typescript@5.2.2)(zod@3.22.2)
crossbell: 1.7.2(typescript@5.2.2)(zod@3.22.2)
transitivePeerDependencies:
- bufferutil
- typescript
@@ -3588,8 +3588,8 @@ packages:
eslint-visitor-keys: 3.4.3
dev: true
/@uiw/codemirror-extensions-events@4.21.15(@codemirror/view@6.20.0):
resolution: {integrity: sha512-6vxiwyJvJ3czCHMHwzNFfpzO3XHFQvnpJy62RtVkVxSfFxaUQm0kgpHhSzc7aGqRAGFqimjLg08X5NjX5KTnxQ==}
/@uiw/codemirror-extensions-events@4.21.16(@codemirror/view@6.20.0):
resolution: {integrity: sha512-SvvXKJnE3VHZJpTLlpqzfZ0WKEjMrMnmFjwYIAcN9MLTc1ME4e5UT6ToVBmIHJwBpfhhj4YHaGX4grq5zfz/dA==}
peerDependencies:
'@codemirror/view': '>=6.0.0'
dependencies:
@@ -5373,8 +5373,8 @@ packages:
which: 2.0.2
dev: true
/crossbell@1.6.4(typescript@5.2.2)(zod@3.22.2):
resolution: {integrity: sha512-6wjWaPW0HqePxKNjaC/YEcknHe5Kx4Icbtoo2p5LQd6c9ggXMpyGSXGnFqvWcU7vxdmcbEfdwYuzFeEPS3jXCA==}
/crossbell@1.7.2(typescript@5.2.2)(zod@3.22.2):
resolution: {integrity: sha512-BYXdFX0XJ7xJp4r4SzYGemRpauYWjcqmfaFAO+vY6bVEQbBsXikw4TT2PEsuePHiDFOqDMMTwvG5QU46VeOKOg==}
engines: {node: '>=16.14.0'}
dependencies:
'@crossbell/ipfs-fetch': 0.0.19
@@ -10372,8 +10372,8 @@ packages:
react-async-script: 1.2.0(react@18.2.0)
dev: false
/react-hook-form@7.46.1(react@18.2.0):
resolution: {integrity: sha512-0GfI31LRTBd5tqbXMGXT1Rdsv3rnvy0FjEk8Gn9/4tp6+s77T7DPZuGEpBRXOauL+NhyGT5iaXzdIM2R6F/E+w==}
/react-hook-form@7.46.2(react@18.2.0):
resolution: {integrity: sha512-x1DWmHQchV7x2Rq9l99M/cQHC8JGchAnw9Z0uTz5KrPa0bTl/Inm1NR7ceOARfIrkNuQNAhuSuZPYa6k7QYn3Q==}
engines: {node: '>=12.22.0'}
peerDependencies:
react: ^16.8.0 || ^17 || ^18
@@ -11590,8 +11590,8 @@ packages:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
/swiper@10.2.0:
resolution: {integrity: sha512-nktQsOtBInJjr3f5DicxC8eHYGcLXDVIGPSon0QoXRaO6NjKnATCbQ8SZsD3dN1Ph1RH4EhVPwSYCcuDRFWHGQ==}
/swiper@10.3.0:
resolution: {integrity: sha512-o81KZH4phL/dJxKFWpZ/zf78QxOyFMood+c86vJJO0ZeSOoniyzV8HWDsw12KOlQdm4WRxrc/6kfGImAcxcS3w==}
engines: {node: '>= 4.7.0'}
dev: false
+6 -4
View File
@@ -42,10 +42,12 @@ export const mantineTheme = createTheme({
})
let mantineDefaultColorSchemeT = "auto"
if (localStorage.getItem(DARK_MODE_STORAGE_KEY) === "light") {
mantineDefaultColorSchemeT = "light"
} else if (localStorage.getItem(DARK_MODE_STORAGE_KEY) === "dark") {
mantineDefaultColorSchemeT = "dark"
if (typeof localStorage !== "undefined") {
if (localStorage.getItem(DARK_MODE_STORAGE_KEY) === "light") {
mantineDefaultColorSchemeT = "light"
} else if (localStorage.getItem(DARK_MODE_STORAGE_KEY) === "dark") {
mantineDefaultColorSchemeT = "dark"
}
}
export const mantineDefaultColorScheme = mantineDefaultColorSchemeT as
| "auto"