format
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import {BrowserRouter, Route, Routes, Navigate} from 'react-router-dom';
|
import {BrowserRouter, Route, Routes, Navigate} from 'react-router-dom';
|
||||||
import {ProtectedRoute} from 'components';
|
import {ProtectedRoute} from 'components';
|
||||||
import {LoginForm, ChannelList} from 'views';
|
import {LoginForm, ChannelList, ChannelDetail} from 'views';
|
||||||
|
|
||||||
export default function Router() {
|
export default function Router() {
|
||||||
return (
|
return (
|
||||||
@@ -12,7 +12,7 @@ export default function Router() {
|
|||||||
{/* Protected routes */}
|
{/* Protected routes */}
|
||||||
<Route path="/" element={<Navigate to="/channels" replace />} />
|
<Route path="/" element={<Navigate to="/channels" replace />} />
|
||||||
<Route path="/channels" element={<ProtectedRoute component={<ChannelList />} />} />
|
<Route path="/channels" element={<ProtectedRoute component={<ChannelList />} />} />
|
||||||
|
<Route path="/channels/:channelId" element={<ProtectedRoute component={<ChannelDetail />} />} />
|
||||||
{/* Fallback route */}
|
{/* Fallback route */}
|
||||||
<Route path="*" element={<Navigate to="/login" replace />} />
|
<Route path="*" element={<Navigate to="/login" replace />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
5
src/views/ChannelDetail/ChannelDetail.tsx
Normal file
5
src/views/ChannelDetail/ChannelDetail.tsx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { JSX } from 'react';
|
||||||
|
|
||||||
|
export function ChannelDetail(): JSX.Element {
|
||||||
|
return <div>ChannelDetail</div>;
|
||||||
|
}
|
||||||
1
src/views/ChannelDetail/index.ts
Normal file
1
src/views/ChannelDetail/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './ChannelDetail';
|
||||||
@@ -102,12 +102,14 @@ export const ChannelList = (): React.JSX.Element => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFetching) {
|
||||||
|
return <ChannelListLoading />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Body className="table-container">
|
<Body className="table-container">
|
||||||
{isFetching ? (
|
{channels.length === 0 ? (
|
||||||
<ChannelListLoading />
|
|
||||||
) : channels.length === 0 ? (
|
|
||||||
<Main>
|
<Main>
|
||||||
<div style={{textAlign: 'center', padding: '2rem'}}>
|
<div style={{textAlign: 'center', padding: '2rem'}}>
|
||||||
<h3>No channels found</h3>
|
<h3>No channels found</h3>
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export * from './LoginForm';
|
export * from './LoginForm';
|
||||||
export * from './ChannelList';
|
export * from './ChannelList';
|
||||||
|
export * from './ChannelDetail';
|
||||||
|
|||||||
Reference in New Issue
Block a user