You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
2.6 KiB
110 lines
2.6 KiB
import Home from '../pages/Home.jsx'
|
|
import Login from '../pages/Login.jsx'
|
|
import Register from '../pages/Register.jsx'
|
|
import Video from '../pages/Video.jsx'
|
|
import ProtectedRoute from '../components/ProtectedRoute.jsx'
|
|
import Account from "../pages/Account.jsx";
|
|
import ManageChannel from "../pages/ManageChannel.jsx";
|
|
import ManageVideo from "../pages/ManageVideo.jsx";
|
|
import AddVideo from "../pages/AddVideo.jsx";
|
|
import Search from "../pages/Search.jsx";
|
|
import Channel from "../pages/Channel.jsx";
|
|
import Playlist from "../pages/Playlist.jsx";
|
|
import LoginSuccess from '../pages/LoginSuccess.jsx'
|
|
import Subscriptions from '../pages/Subscription.jsx'
|
|
|
|
const routes = [
|
|
{ path: "/", element: <Home/> },
|
|
{
|
|
path: "/login",
|
|
element: (
|
|
<ProtectedRoute requireAuth={false}>
|
|
<Login />
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/register",
|
|
element: (
|
|
<ProtectedRoute requireAuth={false}>
|
|
<Register />
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/video/:id",
|
|
element: (
|
|
<ProtectedRoute requireAuth={false}>
|
|
<Video />
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/profile",
|
|
element: (
|
|
<ProtectedRoute requireAuth={true}>
|
|
<Account/>
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/manage-channel/:id",
|
|
element: (
|
|
<ProtectedRoute requireAuth={true}>
|
|
<ManageChannel/>
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/manage-video/:id",
|
|
element: (
|
|
<ProtectedRoute requireAuth={true}>
|
|
<ManageVideo/>
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/add-video",
|
|
element: (
|
|
<ProtectedRoute requireAuth={true}>
|
|
<AddVideo/>
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "search",
|
|
element: (
|
|
<Search />
|
|
)
|
|
},
|
|
{
|
|
path: "channel/:id",
|
|
element: (
|
|
<Channel/>
|
|
)
|
|
},
|
|
{
|
|
path: "playlist/:id",
|
|
element: (
|
|
<ProtectedRoute requireAuth={true}>
|
|
<Playlist/>
|
|
</ProtectedRoute>
|
|
)
|
|
},
|
|
{
|
|
path: "/login/success",
|
|
element: (
|
|
<LoginSuccess/>
|
|
)
|
|
},
|
|
{
|
|
path: "/subscriptions",
|
|
element: (
|
|
<ProtectedRoute requireAuth={true}>
|
|
<Subscriptions/>
|
|
</ProtectedRoute>
|
|
)
|
|
}
|
|
]
|
|
|
|
export default routes;
|