Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: Adjustment of the toast component's position from the top

shuaife12e11b62d1
diff --git a/ui/src/hooks/useExternalToast/index.tsx b/ui/src/hooks/useExternalToast/index.tsx
index 9bbc5883..b6f077a6 100644
--- a/ui/src/hooks/useExternalToast/index.tsx
+++ b/ui/src/hooks/useExternalToast/index.tsx
@@ -28,7 +28,7 @@ import { Storage } from '@/utils';
const toastPortal = document.createElement('div');
toastPortal.style.position = 'fixed';
-toastPortal.style.top = '90px';
+toastPortal.style.top = '78px';
toastPortal.style.left = '50%';
toastPortal.style.transform = 'translate(-50%, 0)';
toastPortal.style.maxWidth = '100%';
@@ -37,7 +37,7 @@ toastPortal.style.zIndex = '1001';
const setPortalPosition = () => {
const header = document.querySelector('#header');
if (header) {
- toastPortal.style.top = `${header.getBoundingClientRect().top + 90}px`;
+ toastPortal.style.top = `${header.getBoundingClientRect().top + 78}px`;
}
};
const startHandlePortalPosition = () => {
diff --git a/ui/src/hooks/useToast/index.tsx b/ui/src/hooks/useToast/index.tsx
index ae91a444..1aaff47a 100644
--- a/ui/src/hooks/useToast/index.tsx
+++ b/ui/src/hooks/useToast/index.tsx
@@ -24,7 +24,7 @@ import ReactDOM from 'react-dom/client';
const toastPortal = document.createElement('div');
toastPortal.style.position = 'fixed';
-toastPortal.style.top = '90px';
+toastPortal.style.top = '78px';
toastPortal.style.left = '50%';
toastPortal.style.transform = 'translate(-50%, 0)';
toastPortal.style.maxWidth = '100%';
@@ -33,7 +33,7 @@ toastPortal.style.zIndex = '1001';
const setPortalPosition = () => {
const header = document.querySelector('#header');
if (header) {
- toastPortal.style.top = `${header.getBoundingClientRect().top + 90}px`;
+ toastPortal.style.top = `${header.getBoundingClientRect().top + 78}px`;
}
};
const startHandlePortalPosition = () => {