From 9e95602dc168e9ace3f6273a4262664757484428 Mon Sep 17 00:00:00 2001 From: optrader Date: Sun, 23 Nov 2025 12:54:52 +0900 Subject: [PATCH] [251123] fix: DetailPanel ThemeContent-5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 23. 12:54:52 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 1๊ฐœ โ€ข ์ถ”๊ฐ€: +40์ค„ โ€ข ์‚ญ์ œ: -20์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/DetailPanel/ThemeProduct/ThemeContents.jsx ๐Ÿ”ง ํ•จ์ˆ˜ ๋ณ€๊ฒฝ ๋‚ด์šฉ: ๐Ÿ“„ com.twin.app.shoptime/src/views/DetailPanel/ThemeProduct/ThemeContents.jsx (javascript): โœ… Added: getRandomThemeImage() ๐Ÿ”„ Modified: SpotlightContainerDecorator() --- .../ThemeProduct/ThemeContents.jsx | 60 ++++++++++++------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/com.twin.app.shoptime/src/views/DetailPanel/ThemeProduct/ThemeContents.jsx b/com.twin.app.shoptime/src/views/DetailPanel/ThemeProduct/ThemeContents.jsx index f60c6ec3..08396a6d 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/ThemeProduct/ThemeContents.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/ThemeProduct/ThemeContents.jsx @@ -6,6 +6,9 @@ import Spotlight from '@enact/spotlight'; import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDecorator'; import arrowDownIcon from '../../../../assets/images/icons/ic-arrow-down.svg'; +import themeImage1 from '../../../../assets/images/theme/image-1.png'; +import themeImage2 from '../../../../assets/images/theme/image-2.png'; +import themeImage3 from '../../../../assets/images/theme/image-3.png'; import { updatePanel } from '../../../actions/panelActions'; import TButton from '../../../components/TButton/TButton'; import ThemeItemCard from './ThemeItemCard'; @@ -59,12 +62,18 @@ export default function ThemeContents({ const isClickBlocked = useRef(false); const blockTimeoutRef = useRef(null); + // ๋žœ๋ค ์ด๋ฏธ์ง€ ์„ ํƒ ํ•จ์ˆ˜ + const getRandomThemeImage = () => { + const images = [themeImage1, themeImage2, themeImage3]; + return images[Math.floor(Math.random() * images.length)]; + }; + // Mock ๋ฐ์ดํ„ฐ const mockItems = [ { prdtId: 'mock-1', prdtNm: 'Origami Removable Connecting Rack 2-pack', - prdtImgPath: 'https://placehold.co/120x120', + prdtImgPath: getRandomThemeImage(), salePrice: '$32.98', originalPrice: '$150.00', patnrLogoPath: null, @@ -75,10 +84,10 @@ export default function ThemeContents({ }, { prdtId: 'mock-2', - prdtNm: 'Origami Removable Connecting Rack 2-pack', - prdtImgPath: 'https://placehold.co/120x120', - salePrice: '$32.98', - originalPrice: '$150.00', + prdtNm: 'Premium Stainless Steel Cookware Set', + prdtImgPath: getRandomThemeImage(), + salePrice: '$45.99', + originalPrice: '$189.99', patnrLogoPath: null, patncNm: 'Partner 2', showId: 'show-2', @@ -87,10 +96,10 @@ export default function ThemeContents({ }, { prdtId: 'mock-3', - prdtNm: 'Origami Removable Connecting Rack 2-pack', - prdtImgPath: 'https://placehold.co/120x120', - salePrice: '$32.98', - originalPrice: '$150.00', + prdtNm: 'Smart Home Security Camera System', + prdtImgPath: getRandomThemeImage(), + salePrice: '$78.50', + originalPrice: '$299.00', patnrLogoPath: null, patncNm: 'Partner 3', showId: 'show-3', @@ -99,10 +108,10 @@ export default function ThemeContents({ }, { prdtId: 'mock-4', - prdtNm: 'Origami Removable Connecting Rack 2-pack', - prdtImgPath: 'https://placehold.co/120x120', - salePrice: '$32.98', - originalPrice: '$150.00', + prdtNm: 'Ergonomic Office Chair with Lumbar Support', + prdtImgPath: getRandomThemeImage(), + salePrice: '$125.00', + originalPrice: '$450.00', patnrLogoPath: null, patncNm: 'Partner 4', showId: 'show-4', @@ -111,10 +120,10 @@ export default function ThemeContents({ }, { prdtId: 'mock-5', - prdtNm: 'Origami Removable Connecting Rack 2-pack', - prdtImgPath: 'https://placehold.co/120x120', - salePrice: '$32.98', - originalPrice: '$150.00', + prdtNm: 'Wireless Bluetooth Noise-Canceling Headphones', + prdtImgPath: getRandomThemeImage(), + salePrice: '$89.99', + originalPrice: '$249.99', patnrLogoPath: null, patncNm: 'Partner 5', showId: 'show-5', @@ -124,7 +133,15 @@ export default function ThemeContents({ ]; // themeItems๊ฐ€ ๋น„์–ด์žˆ์œผ๋ฉด mock ๋ฐ์ดํ„ฐ ์‚ฌ์šฉ - const displayItems = themeItems && themeItems.length > 0 ? themeItems : mockItems; + const displayItems = useMemo(() => { + if (themeItems && themeItems.length > 0) { + return themeItems; + } + return mockItems.map((item) => ({ + ...item, + prdtImgPath: getRandomThemeImage(), // ๊ฐ ์•„์ดํ…œ๋งˆ๋‹ค ๋žœ๋ค ์ด๋ฏธ์ง€ ์žฌํ• ๋‹น + })); + }, [themeItems]); const handleThemeItemButtonClick = useCallback(() => { if (onThemeItemClose) { @@ -230,9 +247,12 @@ export default function ThemeContents({ }; }, []); - // ํ† ์ŠคํŠธ๊ฐ€ ์—ด๋ฆฌ๋ฉด ๋‹ซ๊ธฐ(=THEME ITEM) ๋ฒ„ํŠผ๋ถ€ํ„ฐ ํฌ์ปค์Šค๋˜๋„๋ก ๋ณด์ • + // ํ† ์ŠคํŠธ๊ฐ€ ์—ด๋ฆฌ๋ฉด THEME ITEM ๋ฒ„ํŠผ์— ํฌ์ปค์Šค๋˜๋„๋ก ๋ณด์ • useEffect(() => { - Spotlight.focus('theme-contents-close-button'); + // ์•ฝ๊ฐ„์˜ ์ง€์—ฐ์„ ์ฃผ์–ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋ Œ๋”๋ง๋œ ํ›„ ํฌ์ปค์Šค ์ด๋™ + setTimeout(() => { + Spotlight.focus('theme-contents-close-button'); + }, 100); }, []); // ํ‚ค ์ด๋™ ๋ณด์ •: ์œ„/์•„๋ž˜/์ขŒ์šฐ ์ด๋™ ์„ค์ •