Skip to content

Commit 6d6a3ab

Browse files
committed
fix nav buttons
1 parent ee31155 commit 6d6a3ab

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.
99
- ⚡️ Desktop: Automatically restart server process when it crashes/exits
1010
- ⚡️ Desktop: Added 'Restart server' button when server process is terminated
1111
- ⚡️ Auto progress update now works for built-in media player
12-
- ⚡️ Desktop: Back/Forward navigation buttons when hovering logo #171
12+
- ⚡️ Desktop: Back/Forward navigation buttons #171
1313
- ⚡️ Open search page by clicking on media genres and ranks #172
1414
- ⚡️ Support for AniList 'repeat' field #169
1515
- ⚡️ Ignore dropped anime in missing episodes #170

seanime-web/src/app/(main)/_features/navigation/main-sidebar.tsx

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ import { useThemeSettings } from "@/lib/theme/hooks"
2727
import { useSetAtom } from "jotai"
2828
import { usePathname, useRouter } from "next/navigation"
2929
import React from "react"
30-
import { AiOutlineArrowLeft, AiOutlineArrowRight } from "react-icons/ai"
3130
import { BiCalendarAlt, BiDownload, BiExtension, BiLogOut, BiNews } from "react-icons/bi"
3231
import { FaBookReader } from "react-icons/fa"
3332
import { FiLogIn, FiSearch, FiSettings } from "react-icons/fi"
3433
import { HiOutlineServerStack } from "react-icons/hi2"
3534
import { IoCloudOfflineOutline, IoLibrary } from "react-icons/io5"
36-
import { PiClockCounterClockwiseFill } from "react-icons/pi"
35+
import { PiArrowCircleLeftDuotone, PiArrowCircleRightDuotone, PiClockCounterClockwiseFill } from "react-icons/pi"
3736
import { SiAnilist } from "react-icons/si"
3837
import { TbWorldDownload } from "react-icons/tb"
3938

@@ -125,28 +124,7 @@ export function MainSidebar() {
125124

126125
<div>
127126
<div className="mb-4 p-4 pb-0 flex justify-center w-full">
128-
{process.env.NEXT_PUBLIC_PLATFORM === "desktop" ? <div className="w-15 h-10 block w-fit">
129-
<HoverCard
130-
side="right"
131-
className="w-fit rounded-full flex gap-2 bg-gray-950 bg-opacity-50 p-2"
132-
trigger={<div className="">
133-
<img src="/logo.png" alt="logo" className="w-15 h-10 block" />
134-
</div>}
135-
>
136-
<IconButton
137-
icon={<AiOutlineArrowLeft />} rounded intent="white-outline" size="sm"
138-
onClick={() => {
139-
router.back()
140-
}}
141-
/>
142-
<IconButton
143-
icon={<AiOutlineArrowRight />} rounded intent="white-outline" size="sm"
144-
onClick={() => {
145-
router.forward()
146-
}}
147-
/>
148-
</HoverCard>
149-
</div> : <img src="/logo.png" alt="logo" className="w-15 h-10" />}
127+
<img src="/logo.png" alt="logo" className="w-15 h-10" />
150128
</div>
151129
<VerticalMenu
152130
className="px-4"
@@ -253,6 +231,32 @@ export function MainSidebar() {
253231
handleUnexpandedSidebar={() => {}}
254232
/>
255233

234+
{process.env.NEXT_PUBLIC_PLATFORM === "desktop" && <div className="block w-fit px-4">
235+
<HoverCard
236+
side="right"
237+
sideOffset={-8}
238+
// className="w-fit rounded-full flex gap-2 bg-gray-950 bg-opacity-50 p-2"
239+
className="bg-transparent border-none"
240+
trigger={<IconButton
241+
intent="gray-basic"
242+
className="px-6 opacity-50 hover:opacity-100"
243+
icon={<PiArrowCircleLeftDuotone />}
244+
onClick={() => {
245+
router.back()
246+
}}
247+
/>}
248+
>
249+
<IconButton
250+
icon={<PiArrowCircleRightDuotone />}
251+
intent="gray-subtle"
252+
className="px-6 opacity-50 hover:opacity-100"
253+
onClick={() => {
254+
router.forward()
255+
}}
256+
/>
257+
</HoverCard>
258+
</div>}
259+
256260
</div>
257261
<div className="flex w-full gap-2 flex-col px-4">
258262
{process.env.NEXT_PUBLIC_PLATFORM !== "desktop" ? <UpdateModal collapsed={isCollapsed} /> :

seanime-web/src/components/ui/hover-card/hover-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const HoverCard = React.forwardRef<HTMLDivElement, HoverCardProps>((props
3737
} = props
3838

3939
return (
40-
<HoverCardPrimitive.Root openDelay={0}>
40+
<HoverCardPrimitive.Root openDelay={1} closeDelay={0}>
4141
<HoverCardPrimitive.Trigger asChild>
4242
{props.trigger}
4343
</HoverCardPrimitive.Trigger>

0 commit comments

Comments
 (0)