Add: components/Button/BackButtonFromNotification.tsx types/type-collect-other.ts Fix: - android/app/build.gradle - app/(application)/(user)/_layout.tsx - app/(application)/(user)/event/(tabs)/_layout.tsx - app/(application)/(user)/event/(tabs)/status.tsx - app/(application)/(user)/event/create.tsx - app/(application)/(user)/job/(tabs)/_layout.tsx - app/(application)/(user)/notifications/index.tsx - app/(application)/admin/event/[id]/[status]/index.tsx - app/(application)/admin/event/[id]/reject-input.tsx - app/(application)/admin/notification/index.tsx - components/Notification/NotificationInitializer.tsx - hipmi-note.md - hooks/use-notification-store.tsx - screens/Admin/Event/funUpdateStatus.ts - service/api-notifications.ts - utils/formatChatTime.ts ### No Issue
30 lines
609 B
TypeScript
30 lines
609 B
TypeScript
import { useRouter } from "expo-router";
|
|
import { BackButton } from "..";
|
|
|
|
export default function BackButtonFromNotification({
|
|
from,
|
|
category,
|
|
}: {
|
|
from: string;
|
|
category?: string;
|
|
}) {
|
|
const router = useRouter();
|
|
return (
|
|
<>
|
|
<BackButton
|
|
onPress={() => {
|
|
if (from === "notifications") {
|
|
router.replace(`/notifications?category=${category}`);
|
|
} else {
|
|
if (from) {
|
|
router.replace(`/${from}` as any);
|
|
} else {
|
|
router.navigate("/home");
|
|
}
|
|
}
|
|
}}
|
|
/>
|
|
</>
|
|
);
|
|
}
|