Merge branch 'staging' of https://github.com/VAR-Virtual-Air-Rescue/var-monorepo into staging
This commit is contained in:
@@ -113,7 +113,6 @@ export const SmartPopup = (
|
||||
);
|
||||
|
||||
const handleConflict = useCallback(() => {
|
||||
console.log("handleConflict in smartMarker", id, options);
|
||||
const newAnchor = calculateAnchor(id, "popup", options);
|
||||
setAnchor(newAnchor);
|
||||
}, [id, options]);
|
||||
|
||||
@@ -37,7 +37,7 @@ const Map = () => {
|
||||
return (
|
||||
<MapContainer
|
||||
ref={ref}
|
||||
className="flex-1 bg-base-200"
|
||||
className="bg-base-200 z-10 flex-1"
|
||||
center={map.center}
|
||||
zoom={map.zoom}
|
||||
fadeAnimation={false}
|
||||
|
||||
34
apps/dispatch/app/_components/navbar/ChangelogWrapper.tsx
Normal file
34
apps/dispatch/app/_components/navbar/ChangelogWrapper.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
"use client";
|
||||
import { Changelog } from "@repo/db";
|
||||
import { ChangelogModalBtn } from "@repo/shared-components";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { editUserAPI } from "_querys/user";
|
||||
import { useSession } from "next-auth/react";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const ChangelogWrapper = ({ latestChangelog }: { latestChangelog: Changelog | null }) => {
|
||||
const { data: session } = useSession();
|
||||
const editUserMutation = useMutation({
|
||||
mutationFn: editUserAPI,
|
||||
});
|
||||
|
||||
const autoOpen = !session?.user.changelogAck && !!latestChangelog;
|
||||
|
||||
if (!latestChangelog) return null;
|
||||
if (!session) return null;
|
||||
|
||||
return (
|
||||
<ChangelogModalBtn
|
||||
hideIcon
|
||||
className="text-sm text-gray-500"
|
||||
latestChangelog={latestChangelog}
|
||||
autoOpen={autoOpen}
|
||||
onClose={async () => {
|
||||
await editUserMutation.mutateAsync({ id: session?.user.id, user: { changelogAck: true } });
|
||||
if (!session?.user.changelogAck) {
|
||||
toast.success("Changelog als gelesen markiert");
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user