Skip to content

Commit cce6bac

Browse files
committed
fix: tina redirect
1 parent b722a42 commit cce6bac

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/pages/admin/index.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import React, { useEffect } from 'react';
2+
import useBaseUrl from '@docusaurus/useBaseUrl';
3+
4+
export default function AdminRedirect() {
5+
const adminUrl = useBaseUrl('/admin/index.html');
26

3-
export default function AdminRedirect(): JSX.Element {
47
useEffect(() => {
5-
const base = document?.querySelector('base')?.getAttribute('href') || '/';
6-
window.location.href = `${base}admin/index.html`;
8+
window.location.href = adminUrl;
79
}, []);
810

9-
return (
10-
<main>
11-
<p>Redirecting to Tina admin...</p>
12-
</main>
13-
);
11+
return <p>Redirecting to Tina Admin...</p>;
1412
}

0 commit comments

Comments
 (0)