From 15fe8a6cc8d47f0bf78e65c6305a1a20b6ec0a1b Mon Sep 17 00:00:00 2001 From: besscroft Date: Fri, 12 Jul 2024 21:12:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=88=91=E4=BB=AC=20nextjs=20?= =?UTF-8?q?=E7=9C=9F=E7=9A=84=E6=98=AF=E5=A4=AA=E5=BC=BA=E8=BE=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MasonryItem.tsx | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/components/MasonryItem.tsx b/components/MasonryItem.tsx index f3f535c..b57df99 100644 --- a/components/MasonryItem.tsx +++ b/components/MasonryItem.tsx @@ -29,23 +29,6 @@ export default function MasonryItem() { data: MasonryViewData, } - async function handleOnClick() { - const url = window.location.origin + (pathname === '/' ? '/preview/' : pathname + '/preview/') + MasonryViewData.id - if (navigator.canShare({ url })) { - try { - await navigator.share({ - title: MasonryViewData.title, - text: MasonryViewData.detail, - url: url - }); - } catch (error) { - toast.warning('分享发生错误!', { duration: 500 }) - } - } else { - toast.warning('您的浏览器不支持!', { duration: 500 }) - } - } - async function downloadImg() { setDownload(true) try { @@ -87,21 +70,6 @@ export default function MasonryItem() {

{MasonryViewData.title}

- { - navigator.canShare && typeof navigator.canShare === 'function' && - - - - } + +
+ } + void setMasonryView: (masonryView: boolean) => void setMasonryViewData: (masonryViewData: ImageType) => void + setMasonryViewDataList: (masonryViewDataList: ImageType[]) => void setTagHelp: (tagHelp: boolean) => void setImageHelp: (imageHelp: boolean) => void setUploadHelp: (uploadHelp: boolean) => void @@ -72,6 +74,7 @@ export const initButtonStore = (): ButtonState => { aListData: [] as Config[], MasonryView: false, MasonryViewData: {} as ImageType, + MasonryViewDataList: [] as ImageType[], tagHelp: false, imageHelp: false, uploadHelp: false, @@ -97,6 +100,7 @@ export const defaultInitState: ButtonState = { aListData: [] as Config[], MasonryView: false, MasonryViewData: {} as ImageType, + MasonryViewDataList: [] as ImageType[], tagHelp: false, imageHelp: false, uploadHelp: false, @@ -163,6 +167,9 @@ export const createButtonStore = ( setMasonryViewData: (masonryViewDataValue) => set(() => ({ MasonryViewData: masonryViewDataValue, })), + setMasonryViewDataList: (masonryViewDataListValue) => set(() => ({ + MasonryViewDataList: masonryViewDataListValue, + })), setTagHelp: (tagHelpValue) => set(() => ({ tagHelp: tagHelpValue, })),