fix: update NotificationButton styling and integrate useNavigator in NotificationPage

This commit is contained in:
2025-11-30 19:49:29 +08:00
parent 96cdd2c41c
commit ae547522ed
2 changed files with 7 additions and 6 deletions

View File

@@ -568,11 +568,9 @@ function NotificationButton() {
return (
<div className="indicator">
{count > 0 && (
<span className="indicator-item badge badge-secondary badge-sm">
{count > 99 ? "99+" : count}
</span>
)}
{count > 0 && <span className="bg-error text-white text-xs rounded-full px-1 indicator-item">
{count > 99 ? "99+" : count}
</span>}
<button
className="btn btn-ghost btn-circle"
onClick={() => {

View File

@@ -11,6 +11,7 @@ import Badge from "../components/badge.tsx";
import Markdown from "react-markdown";
import { ErrorAlert } from "../components/alert.tsx";
import { app } from "../app.ts";
import { useNavigator } from "../components/navigator.tsx";
export default function NotificationPage() {
const [activities, setActivities] = useState<Activity[]>([]);
@@ -18,6 +19,7 @@ export default function NotificationPage() {
const maxPageRef = useRef(1);
const isLoadingRef = useRef(false);
const { t } = useTranslation();
const navigator = useNavigator();
const fetchNextPage = useCallback(async () => {
if (isLoadingRef.current || pageRef.current >= maxPageRef.current) return;
@@ -42,7 +44,8 @@ export default function NotificationPage() {
useEffect(() => {
network.resetUserNotificationsCount();
}, []);
navigator.refresh();
}, [navigator]);
useEffect(() => {
document.title = t("Notifications");