update link

This commit is contained in:
hamid zarghami
2026-06-07 11:48:13 +03:30
parent 8dd00d4cc7
commit 3c9bb6274f
2 changed files with 8 additions and 4 deletions
@@ -2,6 +2,7 @@ import { toast } from "@/components/Toast";
import TrashWithConfrim from "@/components/TrashWithConfrim";
import { Paths } from "@/config/Paths";
import { extractErrorMessage } from "@/helpers/utils";
import { useGetBusiness } from "@/pages/business/hooks/useBusinessData";
import { useDleteCatalog } from "@/pages/catalogue/hooks/useCatalogueData";
import { requestViewerFullscreen } from "@/pages/viewer/utils/viewerFullscreen";
import { Edit, Eye, Share } from "iconsax-react";
@@ -17,9 +18,10 @@ type Props = {
};
const CatalogueItem: FC<Props> = ({ item, refetch }) => {
const { data: business } = useGetBusiness();
const deleteCatalog = useDleteCatalog();
const shareUrl = `${window.location.origin}${Paths.viewer}/${item.id}`;
const shareUrl = `${window.location.origin}${Paths.viewerBySlug}/${business?.data?.slug}/${item.slug}`;
const handleShare = async () => {
try {
@@ -68,7 +70,7 @@ const CatalogueItem: FC<Props> = ({ item, refetch }) => {
</div>
<div className="flex justify-end gap-1 items-center mt-1">
<Link
to={Paths.viewerBySlug + `/${item.slug}`}
to={Paths.viewerBySlug + `/${business?.data?.slug}/${item.slug}`}
onClick={requestViewerFullscreen}
>
<div className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center">
+4 -2
View File
@@ -1,6 +1,7 @@
import Input from "@/components/Input";
import { Paths } from "@/config/Paths";
import { clx } from "@/helpers/utils";
import { useGetBusiness } from "@/pages/business/hooks/useBusinessData";
import HeaderUserMenu from "@/shared/components/HeaderUserMenu";
import { useSharedStore } from "@/shared/store/sharedStore";
import { Eye, HambergerMenu } from "iconsax-react";
@@ -41,8 +42,9 @@ const Header: FC<HeaderProps> = ({
setSearch,
editorCatalogSlug,
} = useSharedStore();
const location = useLocation();
const { data: business } = useGetBusiness();
const location = useLocation();
const editorPathPrefix = `${Paths.editor}/`;
const isEditorRoute =
location.pathname.startsWith(editorPathPrefix) &&
@@ -84,7 +86,7 @@ const Header: FC<HeaderProps> = ({
{isEditorRoute && viewerSlug ? (
<Link
target="_blank"
to={`${Paths.viewerBySlug}/${viewerSlug}`}
to={`${Paths.viewerBySlug}/${business?.data?.slug}/${viewerSlug}`}
className="flex items-center"
aria-label={t("header.open_viewer")}
title={t("header.open_viewer")}