mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-11-14 08:09:13 -06:00
Fix mobile menu not closing when clicking See all notifications
The LinkButton component wasn't passing onClick to internal Link components, only to external anchor tags. This prevented the onClose callback from firing when navigating via the notifications footer link. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
---
|
||||
# sendou.ink-ja9h
|
||||
title: Show all notifications link doesn't close menu on mobile
|
||||
status: todo
|
||||
status: completed
|
||||
type: bug
|
||||
priority: normal
|
||||
created_at: 2026-01-11T19:22:01Z
|
||||
updated_at: 2026-01-11T19:22:01Z
|
||||
updated_at: 2026-01-12T15:32:45Z
|
||||
parent: sendou.ink-6eko
|
||||
---
|
||||
|
||||
|
||||
@@ -495,6 +495,7 @@ function YouPanel({ onClose }: { onClose: () => void }) {
|
||||
<NotificationContent
|
||||
notifications={notifications}
|
||||
unseenIds={unseenIds}
|
||||
onClose={onClose}
|
||||
/>
|
||||
) : null}
|
||||
</MobilePanel>
|
||||
|
||||
@@ -108,6 +108,7 @@ export function LinkButton({
|
||||
data-testid={testId}
|
||||
prefetch={prefetch}
|
||||
preventScrollReset={preventScrollReset}
|
||||
onClick={onClick}
|
||||
>
|
||||
{icon &&
|
||||
React.cloneElement(icon, {
|
||||
|
||||
@@ -39,9 +39,11 @@ export function useNotifications() {
|
||||
export function NotificationContent({
|
||||
notifications,
|
||||
unseenIds,
|
||||
onClose,
|
||||
}: {
|
||||
notifications: LoaderNotification[];
|
||||
unseenIds: number[];
|
||||
onClose?: () => void;
|
||||
}) {
|
||||
const { t } = useTranslation(["common"]);
|
||||
const { revalidate, state } = useRevalidator();
|
||||
@@ -81,13 +83,13 @@ export function NotificationContent({
|
||||
</NotificationsList>
|
||||
)}
|
||||
{notifications.length === NOTIFICATIONS.PEEK_COUNT ? (
|
||||
<NotificationsFooter />
|
||||
<NotificationsFooter onClose={onClose} />
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function NotificationsFooter() {
|
||||
function NotificationsFooter({ onClose }: { onClose?: () => void }) {
|
||||
const { t } = useTranslation(["common"]);
|
||||
|
||||
return (
|
||||
@@ -99,6 +101,7 @@ function NotificationsFooter() {
|
||||
to={NOTIFICATIONS_URL}
|
||||
className="mt-1-5"
|
||||
testId="notifications-see-all-button"
|
||||
onClick={onClose}
|
||||
>
|
||||
{t("common:notifications.seeAll")}
|
||||
</LinkButton>
|
||||
|
||||
Reference in New Issue
Block a user