2022-01-22 20:41:25 +01:00
|
|
|
import { Route, BrowserRouter, Routes } from 'react-router-dom';
|
2022-01-23 23:23:09 +01:00
|
|
|
import Home from './pages/Home';
|
2022-01-22 20:41:25 +01:00
|
|
|
import './App.css';
|
2022-01-23 23:23:09 +01:00
|
|
|
import '@revoltchat/ui/src/styles/dark.css';
|
|
|
|
import '@revoltchat/ui/src/styles/common.css';
|
|
|
|
import RequireAuth from './components/RequireAuth';
|
2022-01-24 19:01:18 +01:00
|
|
|
import DashboardHome from './pages/DashboardHome';
|
|
|
|
import ServerDashboard from './pages/ServerDashboard';
|
2022-01-23 23:23:09 +01:00
|
|
|
|
2022-02-05 20:17:00 +01:00
|
|
|
const API_URL = import.meta.env.VITE_API_URL?.toString()
|
|
|
|
|| 'http://localhost:9000';
|
|
|
|
|
|
|
|
const BOT_PREFIX = import.meta.env.VITE_BOT_PREFIX?.toString()
|
|
|
|
|| '/';
|
2022-01-22 20:41:25 +01:00
|
|
|
|
|
|
|
function App() {
|
|
|
|
return (
|
|
|
|
<BrowserRouter>
|
|
|
|
<Routes>
|
2022-01-23 23:23:09 +01:00
|
|
|
<Route path='/' element={<Home />} />
|
2022-01-24 19:01:18 +01:00
|
|
|
<Route path='/dashboard' element={<RequireAuth><DashboardHome /></RequireAuth>} />
|
|
|
|
<Route path='/dashboard/:serverid' element={<RequireAuth><ServerDashboard /></RequireAuth>} />
|
2022-01-22 20:41:25 +01:00
|
|
|
</Routes>
|
|
|
|
</BrowserRouter>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-01-23 23:23:09 +01:00
|
|
|
export default App;
|
2022-02-05 20:17:00 +01:00
|
|
|
export { API_URL, BOT_PREFIX }
|