This commit is contained in:
Leo Wen
2025-02-07 22:57:50 -08:00
parent f0c2b03976
commit e344b2b371
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ interface PreviewButtonProps {
const PreviewButton = ({ fileName }: PreviewButtonProps) => { const PreviewButton = ({ fileName }: PreviewButtonProps) => {
const handlePreview = () => { const handlePreview = () => {
const url = `/view/${encodeURIComponent(fileName)}`; const url = `/#/view/${encodeURIComponent(fileName)}`;
window.open(url, '_blank'); window.open(url, '_blank');
}; };
+3 -3
View File
@@ -1,5 +1,5 @@
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client'
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; import { Route, Routes, HashRouter } from 'react-router-dom';
import './index.css' import './index.css'
import App from './App.tsx' import App from './App.tsx'
import View from './View.tsx' import View from './View.tsx'
@@ -11,12 +11,12 @@ import Admin from './Admin.tsx'
createRoot(document.getElementById('root')!).render( createRoot(document.getElementById('root')!).render(
<Router> <HashRouter>
<Routes> <Routes>
<Route path="/" element={<App />} /> <Route path="/" element={<App />} />
<Route path="/view/:file" element={<View />} /> <Route path="/view/:file" element={<View />} />
<Route path="/admin" element={<Admin />} /> <Route path="/admin" element={<Admin />} />
</Routes> </Routes>
</Router> </HashRouter>
) )