From 4824f9fd7956e0dfb7ab078be8693802912f0270 Mon Sep 17 00:00:00 2001 From: urjimyu Date: Thu, 22 Feb 2024 08:43:11 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=20393=20?= =?UTF-8?q?=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr-393/assets/{index-ZXvswBQT.js => index-L3la6Fy0.js} | 6 +++--- pr-preview/pr-393/index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename pr-preview/pr-393/assets/{index-ZXvswBQT.js => index-L3la6Fy0.js} (99%) diff --git a/pr-preview/pr-393/assets/index-ZXvswBQT.js b/pr-preview/pr-393/assets/index-L3la6Fy0.js similarity index 99% rename from pr-preview/pr-393/assets/index-ZXvswBQT.js rename to pr-preview/pr-393/assets/index-L3la6Fy0.js index 39f71b03..4a8771a2 100644 --- a/pr-preview/pr-393/assets/index-ZXvswBQT.js +++ b/pr-preview/pr-393/assets/index-L3la6Fy0.js @@ -1931,7 +1931,7 @@ Error generating stack: `+i.message+` display: flex; flex-direction: column; -`,postOpenGraph=async e=>(await post("/opengraph",e)).data,usePostOpenGraph=({body:e})=>{const d=useMutation({mutationFn:postOpenGraph,onSuccess:s=>{console.log("POST 성공, 오픈그래프 data 값",s),console.log("body값",e)},onError:s=>{console.log(s.message)}}),{isError:c}=d;return{mutation:d,isError:c}},GiftAddFirstLinkLayout=({setStep:e,setLinkText:d,itemNum:c,step:s,setOpenGraph:a,targetDate:i,setModalStatus:o,updateAddGiftInfo:_f,addGiftInfo:en})=>{const[fn,nn]=reactExports.useState(!!en.url),[zn,rn]=reactExports.useState(en.url),{mutation:cn}=usePostOpenGraph({body:{BaseURL:zn}}),Pn=xn=>{try{const vn=cn.mutate({BaseURL:xn},{onSuccess:tn=>{const un=tn.title,Xn=tn.image;a({title:un,image:Xn}),console.log("오픈그래프 정보를 가져왔습니다.",{giftTitle:un,giftImage:Xn}),console.log("작성한 링크 텍스트",zn),console.log("fetchOpenGraph 속 response",vn),d(zn),_f({url:zn,imageUrl:Xn}),e(2)},onError:()=>{o(!0),e(3)}})}catch{e(3)}},dn=async()=>{Pn(zn)};return jsxRuntimeExports$1.jsxs(GiftAddLinkLayoutWrapper,{children:[jsxRuntimeExports$1.jsx(LinkAddHeader,{targetDate:i,setStep:e,step:s,url:zn,updateAddGiftInfo:_f}),jsxRuntimeExports$1.jsx(GiftStatusBar,{registeredGiftNum:c,isMargin:!0}),jsxRuntimeExports$1.jsxs(Title$b,{children:[c===0?"첫번째 상품의":"두번째 상품의",jsxRuntimeExports$1.jsx("br",{}),"판매 링크를 입력해주세요"]}),jsxRuntimeExports$1.jsx(InputUrl,{text:zn,setText:rn,setIsActivated:nn}),jsxRuntimeExports$1.jsx(GiftAddBtnWrapper,{setStep:e,isActivated:fn,onClick:dn})]})},MY_GIFT_QUERY_KEY=["myGiftData"],getMyGift=async e=>get(`/gift/my/${e}`),useGetMyGift=({roomId:e})=>{const{data:d,isLoading:c,isError:s}=useSuspenseQuery({queryKey:[MY_GIFT_QUERY_KEY[0],e],queryFn:()=>getMyGift(e)});return{data:d,isLoading:c,isError:s}};async function postNewGift(e){await post("/gift",e)}const usePostGift=(e,d,c,s)=>{const a=useNavigate(),i=useQueryClient();return{mutation:useMutation({mutationFn:postNewGift,onSuccess:()=>{console.log("선물 등록 성공!!"),i.invalidateQueries({queryKey:[MY_GIFT_QUERY_KEY[0],e]}),a(`/add-gift/${e}/${d}`),c(0),s({name:"",cost:0,imageUrl:"",url:""})},onError:_f=>{console.log("선물 등록 에러!!",_f.message)}})}},AddGiftFooterWrapper=ut.footer` +`,postOpenGraph=async e=>(await post("/opengraph",e)).data,usePostOpenGraph=({body:e})=>{const d=useMutation({mutationFn:postOpenGraph,onSuccess:s=>{console.log("POST 성공, 오픈그래프 data 값",s),console.log("body값",e)},onError:s=>{console.log(s.message)}}),{isError:c}=d;return{mutation:d,isError:c}},GiftAddFirstLinkLayout=({setStep:e,setLinkText:d,itemNum:c,step:s,setOpenGraph:a,targetDate:i,setModalStatus:o,updateAddGiftInfo:_f,addGiftInfo:en})=>{const[fn,nn]=reactExports.useState(!!en.url),[zn,rn]=reactExports.useState(en.url),{mutation:cn}=usePostOpenGraph({body:{BaseURL:zn}}),Pn=xn=>{try{const vn=cn.mutate({BaseURL:xn},{onSuccess:tn=>{const un=tn.title,Xn=tn.image;a({title:un,image:Xn}),console.log("오픈그래프 정보를 가져왔습니다.",{giftTitle:un,giftImage:Xn}),console.log("작성한 링크 텍스트",zn),console.log("fetchOpenGraph 속 response",vn),d(zn),_f({url:zn,imageUrl:Xn}),e(2)},onError:()=>{o(!0),e(3)}})}catch{e(3)}},dn=async()=>{Pn(zn)};return jsxRuntimeExports$1.jsxs(GiftAddLinkLayoutWrapper,{children:[jsxRuntimeExports$1.jsx(LinkAddHeader,{targetDate:i,setStep:e,step:s,url:zn,updateAddGiftInfo:_f}),jsxRuntimeExports$1.jsx(GiftStatusBar,{registeredGiftNum:c,isMargin:!0}),jsxRuntimeExports$1.jsxs(Title$b,{children:[c===0?"첫번째 상품의":"두번째 상품의",jsxRuntimeExports$1.jsx("br",{}),"판매 링크를 입력해주세요"]}),jsxRuntimeExports$1.jsx(InputUrl,{text:zn,setText:rn,setIsActivated:nn}),jsxRuntimeExports$1.jsx(GiftAddBtnWrapper,{setStep:e,isActivated:fn,onClick:dn})]})},MY_GIFT_QUERY_KEY=["myGiftData"],getMyGift=async e=>get(`/gift/my/${e}`),useGetMyGift=({roomId:e})=>{const{data:d,isLoading:c,isError:s}=useSuspenseQuery({queryKey:[MY_GIFT_QUERY_KEY[0],e],queryFn:()=>getMyGift(e)});return{data:d,isLoading:c,isError:s}};async function postNewGift(e){await post("/gift",e)}const usePostGift=(e,d,c,s,a)=>{const i=useNavigate(),o=useQueryClient();return{mutation:useMutation({mutationFn:postNewGift,onSuccess:()=>{console.log("선물 등록 성공!!"),o.invalidateQueries({queryKey:[MY_GIFT_QUERY_KEY[0],e]}),i(`/add-gift/${e}/${d}`),c(0),a(!1),s({name:"",cost:0,imageUrl:"",url:""})},onError:en=>{console.log("선물 등록 에러!!",en.message)}})}},AddGiftFooterWrapper=ut.footer` display: flex; justify-content: flex-end; position: absolute; @@ -1951,7 +1951,7 @@ Error generating stack: `+i.message+` border: none; border-radius: 9.9rem; background-color: ${({theme:e})=>e.colors.white}; -`;const putMyPresignedUrl=async({presignedUrl:e,binaryData:d})=>await axios$1.put(e,d,{headers:{"Content-Type":"binary"}}),usePutMyPresignedUrl=()=>({mutation:useMutation({mutationFn:putMyPresignedUrl,onSuccess:d=>{console.log("PUT 성공",d)},onError:d=>{console.log("이미지 PUT 에러!",d.message)}})}),useBinarizeAndPutImage=()=>{const e=usePutMyPresignedUrl();return{binarizeAndPutImage:async({presignedUrl:c,file:s})=>{const a=await s.arrayBuffer(),i=new Uint8Array(a);try{await e.mutation.mutateAsync({presignedUrl:c,binaryData:i})}catch(o){console.error("바이너리 put하다가 error 발생!",o)}}}},postPresignedUrl=async({filename:e})=>{var d,c;try{const s=e?`presigned-url?fileName=${e}`:"";if(s)return(await post(s,e)).data}catch(s){throw s instanceof AxiosError?new Error(((c=(d=s.response)==null?void 0:d.data)==null?void 0:c.message)??s.message):s}},usePostMyPresignedUrl=e=>{const d=useQueryClient();return useMutation({mutationFn:postPresignedUrl,onSuccess:c=>{console.log("usePostPresignedUrl onSuccess 내꺼로 포스트 성공~",c),d.invalidateQueries({queryKey:[MY_GIFT_QUERY_KEY[0],e]})},onError:c=>{console.log("내 선물 PU 받아오던 중 에러가 발생했습니다.",c.message)}})},useGetPresignedUrl=e=>{const d=usePostMyPresignedUrl(e);return{getPresignedUrl:async({fileName:s,setImageUrl:a})=>{if(s){const o=(await d.mutateAsync({filename:s})).presignedUrl,_f=o.split("?")[0];return a(_f),{presignedUrl:o,imageUrlS3:_f}}else return console.log("파일명이 없어서 fetchPresignedUrl을 실행하지 않습니다."),{imageUrl:"",presignedUrl:""}}}},usePutImageUrlToS3=e=>{const{getPresignedUrl:d}=useGetPresignedUrl(e),{binarizeAndPutImage:c}=useBinarizeAndPutImage();return{putImageUrlToS3:async({fileName:a,file:i,roomId:o,setImageUrl:_f})=>{const{presignedUrl:en,imageUrlS3:fn}=await d({roomId:o,fileName:a,setImageUrl:_f});return en&&en!==""?i?await c({presignedUrl:en,file:i}):console.error("파일이 없습니다"):console.log("preSignedUrl이 비어있어서 putPresignedUrl을 실행하지 않습니다."),{imageUrlS3:fn}}}},AddGiftFooter=({targetDate:e,roomId:d,setStep:c,isActivated:s,name:a,cost:i,link:o,file:_f,setImageUrl:en,fileName:fn,updateAddGiftInfo:nn,setIsLoading:zn})=>{const{mutation:rn}=usePostGift(d,e,c,nn),{putImageUrlToS3:cn}=usePutImageUrlToS3(d),Pn=async()=>{zn(!0);const{imageUrlS3:dn}=await cn({fileName:fn,file:_f,roomId:d,setImageUrl:en});s&&rn.mutate({roomId:d,name:a,cost:i,imageUrl:dn,url:o}),zn(!1)};return jsxRuntimeExports$1.jsx(AddGiftFooterWrapper,{children:jsxRuntimeExports$1.jsx(GiftAddNextBtn,{isActivated:s,onClick:Pn,children:"완료"})})},AddGiftWithLinkLayoutWrapper=ut.section` +`;const putMyPresignedUrl=async({presignedUrl:e,binaryData:d})=>await axios$1.put(e,d,{headers:{"Content-Type":"binary"}}),usePutMyPresignedUrl=()=>({mutation:useMutation({mutationFn:putMyPresignedUrl,onSuccess:d=>{console.log("PUT 성공",d)},onError:d=>{console.log("이미지 PUT 에러!",d.message)}})}),useBinarizeAndPutImage=()=>{const e=usePutMyPresignedUrl();return{binarizeAndPutImage:async({presignedUrl:c,file:s})=>{const a=await s.arrayBuffer(),i=new Uint8Array(a);try{await e.mutation.mutateAsync({presignedUrl:c,binaryData:i})}catch(o){console.error("바이너리 put하다가 error 발생!",o)}}}},postPresignedUrl=async({filename:e})=>{var d,c;try{const s=e?`presigned-url?fileName=${e}`:"";if(s)return(await post(s,e)).data}catch(s){throw s instanceof AxiosError?new Error(((c=(d=s.response)==null?void 0:d.data)==null?void 0:c.message)??s.message):s}},usePostMyPresignedUrl=e=>{const d=useQueryClient();return useMutation({mutationFn:postPresignedUrl,onSuccess:c=>{console.log("usePostPresignedUrl onSuccess 내꺼로 포스트 성공~",c),d.invalidateQueries({queryKey:[MY_GIFT_QUERY_KEY[0],e]})},onError:c=>{console.log("내 선물 PU 받아오던 중 에러가 발생했습니다.",c.message)}})},useGetPresignedUrl=e=>{const d=usePostMyPresignedUrl(e);return{getPresignedUrl:async({fileName:s,setImageUrl:a})=>{if(s){const o=(await d.mutateAsync({filename:s})).presignedUrl,_f=o.split("?")[0];return a(_f),{presignedUrl:o,imageUrlS3:_f}}else return console.log("파일명이 없어서 fetchPresignedUrl을 실행하지 않습니다."),{imageUrl:"",presignedUrl:""}}}},usePutImageUrlToS3=e=>{const{getPresignedUrl:d}=useGetPresignedUrl(e),{binarizeAndPutImage:c}=useBinarizeAndPutImage();return{putImageUrlToS3:async({fileName:a,file:i,roomId:o,setImageUrl:_f})=>{const{presignedUrl:en,imageUrlS3:fn}=await d({roomId:o,fileName:a,setImageUrl:_f});return en&&en!==""?i?await c({presignedUrl:en,file:i}):console.error("파일이 없습니다"):console.log("preSignedUrl이 비어있어서 putPresignedUrl을 실행하지 않습니다."),{imageUrlS3:fn}}}},AddGiftFooter=({targetDate:e,roomId:d,setStep:c,isActivated:s,name:a,cost:i,link:o,file:_f,setImageUrl:en,fileName:fn,updateAddGiftInfo:nn,setIsLoading:zn})=>{const{mutation:rn}=usePostGift(d,e,c,nn,zn),{putImageUrlToS3:cn}=usePutImageUrlToS3(d),Pn=async()=>{zn(!0);const{imageUrlS3:dn}=await cn({fileName:fn,file:_f,roomId:d,setImageUrl:en});s&&rn.mutate({roomId:d,name:a,cost:i,imageUrl:dn,url:o})};return jsxRuntimeExports$1.jsx(AddGiftFooterWrapper,{children:jsxRuntimeExports$1.jsx(GiftAddNextBtn,{isActivated:s,onClick:Pn,children:"완료"})})},AddGiftWithLinkLayoutWrapper=ut.section` width: 100%; display: flex; @@ -2059,7 +2059,7 @@ Error generating stack: `+i.message+` } } } -`,ItemTextField=({text:e,handleTextChange:d,type:c,categoryTitle:s,placeholderText:a})=>{const i=_f=>{const en=_f.target.value;d(en)},o=()=>{d("")};return jsxRuntimeExports$1.jsxs(ItemTextFieldWrapper,{children:[jsxRuntimeExports$1.jsx(CategoryTitle,{children:s}),jsxRuntimeExports$1.jsxs(Wrapper,{$hasContent:e.length>0,children:[jsxRuntimeExports$1.jsx(TextField,{children:jsxRuntimeExports$1.jsx(Input,{type:c,value:e,onChange:i,placeholder:a})}),c==="number"?"":jsxRuntimeExports$1.jsx(IconField,{children:e.length>0&&jsxRuntimeExports$1.jsx(SvgIcCancelCircleFinal,{style:{width:"2.4rem",height:"2.4rem"},onClick:o})})]})]})},WriteItemInfo$1=({imageUrl:e,setIsActivated:d,setName:c,setCost:s,setUrl:a,name:i,cost:o,url:_f})=>{const en=(rn,cn)=>{rn.length>0&&cn.length>0&&e!==""?d(!0):d(!1)},fn=rn=>{c(rn),o!==null&&en(rn,o.toString())},nn=rn=>{rn!==null&&(s(rn),en(i,rn.toString()))},zn=rn=>{a(rn)};return jsxRuntimeExports$1.jsxs(WriteItemInfoWrapper,{children:[jsxRuntimeExports$1.jsx(ItemTextField,{type:"text",text:i,handleTextChange:fn,placeholderText:"상품명을 입력해주세요",categoryTitle:"상품이름"}),jsxRuntimeExports$1.jsx(ItemTextField,{text:o?o.toString():"",handleTextChange:rn=>nn(Number(rn)),type:"number",categoryTitle:"가격",placeholderText:"가격을 입력해주세요"}),jsxRuntimeExports$1.jsx(ItemTextField,{text:_f,handleTextChange:zn,categoryTitle:"링크",placeholderText:"링크를 입력해주세요 (선택)",type:"text"})]})},AddGiftWithoutLinkLayout=({roomId:e,step:d,setStep:c,linkText:s,setLinkText:a,targetDate:i,updateAddGiftInfo:o,modalStatus:_f,addGiftInfo:en,setIsLoading:fn})=>{const[nn,zn]=reactExports.useState(!!en.name&&!!en.cost&&!!en.url&&!!en.imageUrl),[rn,cn]=reactExports.useState(en.name),[Pn,dn]=reactExports.useState(en.cost),[xn,vn]=reactExports.useState(en.imageUrl),[tn,un]=reactExports.useState(""),[Xn,jn]=reactExports.useState(null),[,On]=reactExports.useState(!1),[,an]=reactExports.useState(null),[bn,Nn]=reactExports.useState(_f),Vn=Mn=>Mn===null?0:Mn,qn=()=>{Nn(!bn),c(3)};return jsxRuntimeExports$1.jsxs(AddGiftWithLinkLayoutWrapper,{children:[bn&&jsxRuntimeExports$1.jsxs(Modal,{onConfirmClick:qn,children:["상품 정보를 자동으로",jsxRuntimeExports$1.jsx("br",{}),"불러올 수 없어요 ",jsxRuntimeExports$1.jsx("br",{})]}),jsxRuntimeExports$1.jsx(LinkAddHeader,{targetDate:i,setStep:c,step:d,name:rn,cost:Pn,imageUrl:xn,updateAddGiftInfo:o}),jsxRuntimeExports$1.jsx(GiftStatusBar,{registeredGiftNum:1,isMargin:!0}),jsxRuntimeExports$1.jsx(AddGiftImg,{imageUrl:xn,openGraph:null,setFile:jn,setFileName:un,setImageUrl:vn,setPreviewImage:an,setIsImageUploaded:On}),jsxRuntimeExports$1.jsx(WriteItemInfo$1,{imageUrl:xn,setIsActivated:zn,setName:cn,setCost:dn,setUrl:a,name:rn,cost:Pn,url:s}),jsxRuntimeExports$1.jsx(AddGiftFooter,{targetDate:i,name:rn,cost:Vn(Pn),link:s,setStep:c,isActivated:nn,roomId:e,fileName:tn,updateAddGiftInfo:o,file:Xn,setImageUrl:vn,setIsLoading:fn})]})},GiftAddPageWrapper=ut.div` +`,ItemTextField=({text:e,handleTextChange:d,type:c,categoryTitle:s,placeholderText:a})=>{const i=_f=>{const en=_f.target.value;d(en)},o=()=>{d("")};return jsxRuntimeExports$1.jsxs(ItemTextFieldWrapper,{children:[jsxRuntimeExports$1.jsx(CategoryTitle,{children:s}),jsxRuntimeExports$1.jsxs(Wrapper,{$hasContent:e.length>0,children:[jsxRuntimeExports$1.jsx(TextField,{children:jsxRuntimeExports$1.jsx(Input,{type:c,value:e,onChange:i,placeholder:a})}),c==="number"?"":jsxRuntimeExports$1.jsx(IconField,{children:e.length>0&&jsxRuntimeExports$1.jsx(SvgIcCancelCircleFinal,{style:{width:"2.4rem",height:"2.4rem"},onClick:o})})]})]})},WriteItemInfo$1=({imageUrl:e,setIsActivated:d,setName:c,setCost:s,setUrl:a,name:i,cost:o,url:_f})=>{const en=(rn,cn)=>{rn.length>0&&cn.length>0&&e!==""?d(!0):d(!1)},fn=rn=>{c(rn),o!==null&&en(rn,o.toString())},nn=rn=>{rn!==null&&(s(rn),en(i,rn.toString()))},zn=rn=>{a(rn)};return jsxRuntimeExports$1.jsxs(WriteItemInfoWrapper,{children:[jsxRuntimeExports$1.jsx(ItemTextField,{type:"text",text:i,handleTextChange:fn,placeholderText:"상품명을 입력해주세요",categoryTitle:"상품이름"}),jsxRuntimeExports$1.jsx(ItemTextField,{text:o?o.toString():"",handleTextChange:rn=>nn(Number(rn)),type:"number",categoryTitle:"가격",placeholderText:"가격을 입력해주세요"}),jsxRuntimeExports$1.jsx(ItemTextField,{text:_f,handleTextChange:zn,categoryTitle:"링크",placeholderText:"링크를 입력해주세요 (선택)",type:"text"})]})},AddGiftWithoutLinkLayout=({roomId:e,step:d,setStep:c,linkText:s,setLinkText:a,targetDate:i,updateAddGiftInfo:o,modalStatus:_f,addGiftInfo:en,setIsLoading:fn})=>{const[nn,zn]=reactExports.useState(!!en.name&&!!en.cost&&!!en.url&&!!en.imageUrl),[rn,cn]=reactExports.useState(en.name),[Pn,dn]=reactExports.useState(en.cost),[xn,vn]=reactExports.useState(en.imageUrl),[tn,un]=reactExports.useState(""),[Xn,jn]=reactExports.useState(null),[,On]=reactExports.useState(!1),[,an]=reactExports.useState(null),[bn,Nn]=reactExports.useState(_f),Vn=Mn=>Mn===null?0:Mn,qn=()=>{Nn(!1),c(3)};return jsxRuntimeExports$1.jsxs(AddGiftWithLinkLayoutWrapper,{children:[bn&&jsxRuntimeExports$1.jsxs(Modal,{onConfirmClick:qn,children:["상품 정보를 자동으로",jsxRuntimeExports$1.jsx("br",{}),"불러올 수 없어요 ",jsxRuntimeExports$1.jsx("br",{})]}),jsxRuntimeExports$1.jsx(LinkAddHeader,{targetDate:i,setStep:c,step:d,name:rn,cost:Pn,imageUrl:xn,updateAddGiftInfo:o}),jsxRuntimeExports$1.jsx(GiftStatusBar,{registeredGiftNum:1,isMargin:!0}),jsxRuntimeExports$1.jsx(AddGiftImg,{imageUrl:xn,openGraph:null,setFile:jn,setFileName:un,setImageUrl:vn,setPreviewImage:an,setIsImageUploaded:On}),jsxRuntimeExports$1.jsx(WriteItemInfo$1,{imageUrl:xn,setIsActivated:zn,setName:cn,setCost:dn,setUrl:a,name:rn,cost:Pn,url:s}),jsxRuntimeExports$1.jsx(AddGiftFooter,{targetDate:i,name:rn,cost:Vn(Pn),link:s,setStep:c,isActivated:nn,roomId:e,fileName:tn,updateAddGiftInfo:o,file:Xn,setImageUrl:vn,setIsLoading:fn})]})},GiftAddPageWrapper=ut.div` display: flex; flex-direction: column; justify-content: flex-end; diff --git a/pr-preview/pr-393/index.html b/pr-preview/pr-393/index.html index 9109331c..a4163c6d 100644 --- a/pr-preview/pr-393/index.html +++ b/pr-preview/pr-393/index.html @@ -33,7 +33,7 @@ name="description" content="스윗에서는 모두가 함께하는 선물 등록과 토너먼트를 통해 한 사람을 위한 의미있는 선물을 고를 수 있습니다." /> - +