From 8479bd647bc4e5731c18a4706f63a23426f35cf4 Mon Sep 17 00:00:00 2001 From: seojisoosoo <76681519+seojisoosoo@users.noreply.github.com> Date: Sat, 21 Dec 2024 23:41:52 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B4=91=EA=B3=A0=20=EA=B5=AC=EC=A2=8C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20(#1709)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 디바운싱 임시 주석 처리 * feat: 1222 광고 구좌 변경 --- .../common/Banner/AdsBanner/constants/ads.ts | 8 ++-- src/hooks/useImageUploader.ts | 47 +++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/components/common/Banner/AdsBanner/constants/ads.ts b/src/components/common/Banner/AdsBanner/constants/ads.ts index 2d0e4e5a5..2a9a7c256 100644 --- a/src/components/common/Banner/AdsBanner/constants/ads.ts +++ b/src/components/common/Banner/AdsBanner/constants/ads.ts @@ -1,12 +1,12 @@ export const ADS = [ { - // 이현진 님 + // 송승훈 님 id: 1, moImage: - 'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241124-20241207/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+(%E1%84%86%E1%85%A9%E1%84%87%E1%85%A1%E1%84%8B%E1%85%B5%E1%86%AF+%E1%84%87%E1%85%A5%E1%84%8C%E1%85%A5%E1%86%AB).png', + 'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241222-/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+%E1%84%89%E1%85%A1%E1%86%BC%E1%84%83%E1%85%A1%E1%86%AB%E1%84%87%E1%85%A2%E1%84%82%E1%85%A5+(MO)_%E1%84%8E%E1%85%AC%E1%84%8C%E1%85%A9%E1%86%BC.png', pcImage: - 'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241124-20241207/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+(PC+%E1%84%87%E1%85%A5%E1%84%8C%E1%85%A5%E1%86%AB).png', - url: 'https://playground.sopt.org/group/detail?id=394&fbclid=PAZXh0bgNhZW0CMTEAAabm-2g8SKZjOhiJs17TJxwrBRLjAek6f3rxg89MpBrhCFR_KHvZ8DMZu3M_aem_H1uBBjFciE9mA3RMayJTfA', + 'https://sopt-makers-internal.s3.ap-northeast-2.amazonaws.com/prod/image/advertisements/20241222-/%E1%84%8F%E1%85%A5%E1%84%86%E1%85%B2%E1%84%82%E1%85%B5%E1%84%90%E1%85%B5+%E1%84%89%E1%85%A1%E1%86%BC%E1%84%83%E1%85%A1%E1%86%AB%E1%84%87%E1%85%A2%E1%84%82%E1%85%A5+(PC)_%E1%84%8E%E1%85%AC%E1%84%8C%E1%85%A9%E1%86%BC.png', + url: 'https://www.miricanvas.com/campaign/end_of_year_2024?from=event_sopt', }, { // 메이커스 마케팅 오거나이저 diff --git a/src/hooks/useImageUploader.ts b/src/hooks/useImageUploader.ts index 15445cb9f..86fcea15d 100644 --- a/src/hooks/useImageUploader.ts +++ b/src/hooks/useImageUploader.ts @@ -1,4 +1,3 @@ -import debounce from 'lodash-es/debounce'; import { useRef } from 'react'; import { getPresignedUrl, putPresignedUrl } from '@/api/endpoint/common/image'; @@ -26,33 +25,33 @@ export default function useImageUploader({ onSuccess, resizeHeight }: Options) { // : await Promise.all(Array.from(inputEl.files).map((file) => tryResizeFile(file, resizeHeight))); const files = inputEl.files; - const uploadFiles = debounce(async () => { - const urls: string[] = []; + // const uploadFiles = debounce(async () => { + const urls: string[] = []; - await Promise.all( - Array.from(files).map(async (file) => { - try { - const { filename, signedUrl } = await getPresignedUrl.request({ filename: file.name }); - if (!signedUrl) { - throw new Error('presigned-url을 받아오는데 실패하였습니다.'); - } + await Promise.all( + Array.from(files).map(async (file) => { + try { + const { filename, signedUrl } = await getPresignedUrl.request({ filename: file.name }); + if (!signedUrl) { + throw new Error('presigned-url을 받아오는데 실패하였습니다.'); + } - await putPresignedUrl({ - signedUrl: decodeURIComponent(signedUrl), - file, - }); + await putPresignedUrl({ + signedUrl: decodeURIComponent(signedUrl), + file, + }); - const s3Url = `https://s3.ap-northeast-2.amazonaws.com/sopt-makers-internal/${filename}`; - urls.push(s3Url); - } catch (error) { - console.error(error); - } - }), - ); - onSuccess?.(urls); - }, 500); + const s3Url = `https://s3.ap-northeast-2.amazonaws.com/sopt-makers-internal/${filename}`; + urls.push(s3Url); + } catch (error) { + console.error(error); + } + }), + ); + onSuccess?.(urls); + // }, 500); - uploadFiles(); + // uploadFiles(); }; inputEl.click();