Skip to content

Commit

Permalink
feat: back button for profile and discover page
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jun 3, 2024
1 parent 546cc51 commit 69b9c86
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 15 deletions.
13 changes: 13 additions & 0 deletions src/renderer/src/pages/(main)/(context)/(nonhome)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Link, Outlet } from "react-router-dom"

export function Component() {
return (
<div className="relative flex size-full">
<Link to="/" className="absolute left-10 top-11 flex items-center gap-1">
<i className="i-mingcute-back-line" />
Back
</Link>
<Outlet />
</div>
)
}
42 changes: 27 additions & 15 deletions src/renderer/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,36 @@ export const router = createBrowserRouter([
lazy: () => import("./pages/(main)/(context)/index"),
},
{
path: "/discover",
lazy: () => import("./pages/(main)/(context)/discover/layout"),
children: [
{
path: "",
lazy: () =>
import("./pages/(main)/(context)/discover/index"),
},
],
},
{
path: "/profile",
lazy: () => import("./pages/(main)/(context)/profile/layout"),
path: "",
lazy: () => import("./pages/(main)/layout"),
children: [
{
path: "",
lazy: () =>
import("./pages/(main)/(context)/profile/index"),
lazy: () => import("./pages/(main)/(context)/(nonhome)/layout"),
children: [
{
path: "/discover",
lazy: () => import("./pages/(main)/(context)/(nonhome)/discover/layout"),
children: [
{
path: "",
lazy: () =>
import("./pages/(main)/(context)/(nonhome)/discover/index"),
},
],
},
{
path: "/profile",
lazy: () => import("./pages/(main)/(context)/(nonhome)/profile/layout"),
children: [
{
path: "",
lazy: () =>
import("./pages/(main)/(context)/(nonhome)/profile/index"),
},
],
},
],
},
],
},
Expand Down

0 comments on commit 69b9c86

Please sign in to comment.