diff --git a/apps/jurumarble/src/app/main/components/Carousel.tsx b/apps/jurumarble/src/app/main/components/Carousel.tsx index 94a27bc3..e3330c44 100644 --- a/apps/jurumarble/src/app/main/components/Carousel.tsx +++ b/apps/jurumarble/src/app/main/components/Carousel.tsx @@ -1,10 +1,9 @@ import { useRef } from 'react'; import { ContentSwiper } from '@monorepo/ui'; +import DrinkImageWrapper from 'components/DrinkImageWrapper'; import Path from 'lib/Path'; import { GetHotDrinkResponse } from 'lib/apis/drink'; -import { classifyImageUrl } from 'lib/utils/classifyImageUrl'; -import Image from 'next/image'; import { useRouter } from 'next/navigation'; import { SvgIcPrevious, SvgNext } from 'src/assets/icons/components'; import styled, { css } from 'styled-components'; @@ -46,7 +45,6 @@ function Carousel({ hotDrinkList }: Props) { modules: [Autoplay], }} renderItem={({ drinkId, image, name, manufactureAddress }, index) => { - const imageUrl = classifyImageUrl(image); return ( - + {index + 1} - 전통주 - + {name} {manufactureAddress} @@ -113,7 +110,7 @@ const Box = styled.div` `} `; -const DrinkImageWrapper = styled.div` +const DrinkImageContainer = styled.div` width: 100px; height: 100px; position: relative; diff --git a/apps/jurumarble/src/app/main/components/HotDrinkVoteContainer.tsx b/apps/jurumarble/src/app/main/components/HotDrinkVoteContainer.tsx index 95a87998..924b423f 100644 --- a/apps/jurumarble/src/app/main/components/HotDrinkVoteContainer.tsx +++ b/apps/jurumarble/src/app/main/components/HotDrinkVoteContainer.tsx @@ -1,8 +1,7 @@ 'use client'; +import DrinkImageWrapper from 'components/DrinkImageWrapper'; import Path from 'lib/Path'; -import { classifyImageUrl } from 'lib/utils/classifyImageUrl'; -import Image from 'next/image'; import { useRouter } from 'next/navigation'; import styled, { css } from 'styled-components'; @@ -19,9 +18,6 @@ function HotDrinkVoteContainer() { const nowTime = new Date().getHours(); - const imageAUrl = classifyImageUrl(drinkAImage); - const imageBUrl = classifyImageUrl(drinkBImage); - return ( <>

@@ -34,24 +30,22 @@ function HotDrinkVoteContainer() { > - - A 이미지 + - + - - B 이미지 + - + @@ -120,7 +114,7 @@ const DrinkImageBox = styled.div<{ color: string }>` `} `; -const DrinkImageWrapper = styled.div` +const ImageWrapper = styled.div` width: 80px; height: 80px; position: relative; diff --git a/apps/jurumarble/src/app/my/components/VoteDescription.tsx b/apps/jurumarble/src/app/my/components/VoteDescription.tsx index 181d183b..79f0222a 100644 --- a/apps/jurumarble/src/app/my/components/VoteDescription.tsx +++ b/apps/jurumarble/src/app/my/components/VoteDescription.tsx @@ -1,5 +1,6 @@ import AorBMark from 'components/AorBMark'; -import Image, { StaticImageData } from 'next/image'; +import DrinkImageWrapper from 'components/DrinkImageWrapper'; +import { StaticImageData } from 'next/image'; import styled, { css } from 'styled-components'; interface Props { @@ -13,7 +14,7 @@ function VoteDescription({ imageA, imageB }: Props) { {imageA ? ( - A이미지 {imageB ? ( - B이미지 - {name} diff --git a/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx b/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx index f0760c2e..7774f07f 100644 --- a/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx +++ b/apps/jurumarble/src/app/search/components/DrinkVoteItem.tsx @@ -1,6 +1,5 @@ import Path from 'lib/Path'; import { isLogin } from 'lib/utils/auth'; -import { classifyImageUrl } from 'lib/utils/classifyImageUrl'; import { useRouter } from 'next/navigation'; import useBookmarkService from 'services/useBookmarkService'; import { Content } from 'src/types/vote'; @@ -20,9 +19,6 @@ interface Props { function DrinkVoteItem({ voteDrink, onToggleReplaceLoginPageModal }: Props) { const { voteId, region, title, imageA, imageB, votedCount } = voteDrink; - const imageAUrl = classifyImageUrl(imageA); - const imageBUrl = classifyImageUrl(imageB); - const { isBookmark, mutateBookMark } = useBookmarkService(voteId); const router = useRouter(); @@ -42,7 +38,7 @@ function DrinkVoteItem({ voteDrink, onToggleReplaceLoginPageModal }: Props) { isBookmark={isBookmark} votedCount={votedCount} /> - + ); } diff --git a/apps/jurumarble/src/app/search/components/VoteDescription.tsx b/apps/jurumarble/src/app/search/components/VoteDescription.tsx index b49a8b61..1e92b101 100644 --- a/apps/jurumarble/src/app/search/components/VoteDescription.tsx +++ b/apps/jurumarble/src/app/search/components/VoteDescription.tsx @@ -1,9 +1,10 @@ -import Image, { StaticImageData } from 'next/image'; +import DrinkImageWrapper from 'components/DrinkImageWrapper'; +import { StaticImageData } from 'next/image'; import styled from 'styled-components'; interface Props { - imageA: string | StaticImageData; - imageB: string | StaticImageData; + imageA: string; + imageB: string; } function VoteDescription({ imageA, imageB }: Props) { @@ -11,10 +12,10 @@ function VoteDescription({ imageA, imageB }: Props) { - A 이미지 + - B 이미지 + diff --git a/apps/jurumarble/src/lib/utils/classifyImageUrl.ts b/apps/jurumarble/src/lib/utils/classifyImageUrl.ts deleted file mode 100644 index 191a2b26..00000000 --- a/apps/jurumarble/src/lib/utils/classifyImageUrl.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @TODO DrinkImage 의존성 제거 - */ - -import { DrinkImage } from 'public/images'; - -export function classifyImageUrl(imageUrl: string) { - const regex = - /elasticbeanstalk-ap-northeast-2-319210348301\.s3\.ap-northeast-2\.amazonaws\.com/; - if (imageUrl && regex.test(imageUrl)) { - return DrinkImage; - } - return imageUrl; -}