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