fix: page error while route changing

This commit is contained in:
jialin
2026-04-08 18:54:06 +08:00
committed by jialin
parent 1c09cc6c8c
commit 53cd8ba00c
4 changed files with 10 additions and 6 deletions
+1
View File
@@ -96,6 +96,7 @@ export default {
colorText: '#ccc', colorText: '#ccc',
colorPrimary: COLOR_PRIMARY, colorPrimary: COLOR_PRIMARY,
colorSuccess: '#48A77E', colorSuccess: '#48A77E',
colorBorder: '#3a3a3a',
borderRadius: 4, borderRadius: 4,
borderRadiusSM: 2, borderRadiusSM: 2,
fontSize: 14, fontSize: 14,
+3
View File
@@ -88,6 +88,8 @@ html {
--ant-line-type: solid; --ant-line-type: solid;
--ant-line-width: 1px; --ant-line-width: 1px;
--color-esc-hint-bg: rgba(0, 0, 0, 75%); --color-esc-hint-bg: rgba(0, 0, 0, 75%);
// ======== container ============
--color-border-container: #ededed;
} }
html[data-theme='realDark'] { html[data-theme='realDark'] {
@@ -104,6 +106,7 @@ html[data-theme='realDark'] {
--color-modal-box-shadow: none; --color-modal-box-shadow: none;
--color-spotlight-bg: #3e3e3e; --color-spotlight-bg: #3e3e3e;
--color-esc-hint-bg: rgba(150, 150, 150, 75%); --color-esc-hint-bg: rgba(150, 150, 150, 75%);
--color-border-container: #3a3a3a;
background: #141414; background: #141414;
+5 -5
View File
@@ -16,7 +16,7 @@ export default function useBodyScroll() {
instanceRef.current = window.__GPUSTACK_BODY_SCROLLER__; instanceRef.current = window.__GPUSTACK_BODY_SCROLLER__;
}; };
const saveScrollHeight = React.useCallback(() => { const saveScrollHeight = () => {
if (!bodyScroller.current) { if (!bodyScroller.current) {
init(); init();
} }
@@ -27,12 +27,12 @@ export default function useBodyScroll() {
instanceRef.current?.options?.({ instanceRef.current?.options?.({
overflow: { overflow: {
x: 'hidden', x: 'hidden',
y: 'visible' y: 'hidden'
} }
}); });
}, []); };
const restoreScrollHeight = React.useCallback(() => { const restoreScrollHeight = () => {
if (timer.current) { if (timer.current) {
clearTimeout(timer.current); clearTimeout(timer.current);
} }
@@ -44,7 +44,7 @@ export default function useBodyScroll() {
} }
}); });
}, 650); }, 650);
}, []); };
React.useEffect(() => { React.useEffect(() => {
init(); init();
+1 -1
View File
@@ -21,7 +21,7 @@
height: calc(100vh - 56px); height: calc(100vh - 56px);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border: 1px solid rgb(237, 237, 237); border: 1px solid var(--color-border-container);
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
background-color: var(--ant-color-bg-container); background-color: var(--ant-color-bg-container);