From fe9781ff1cba80bd26eb23f06e2754686f7f94eb Mon Sep 17 00:00:00 2001 From: optrader Date: Tue, 11 Nov 2025 19:49:44 +0900 Subject: [PATCH] [251111] docs: views - ShopNowContents.jsx, TabContainerV2-Divider-Pro... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 11. 19:49:42 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 2๊ฐœ โ€ข ์ถ”๊ฐ€: +2์ค„ โ€ข ์‚ญ์ œ: -1์ค„ ๐Ÿ“ ์ถ”๊ฐ€๋œ ํŒŒ์ผ: + com.twin.app.shoptime/.docs/player-panel/TabContainerV2-Divider-Problem-Analysis.md ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ๊ฐœ๋ฐœ ๋ฌธ์„œ ๋ฐ ๊ฐ€์ด๋“œ ๊ฐœ์„  --- ...TabContainerV2-Divider-Problem-Analysis.md | 175 ++++++++++++++++++ .../TabContents/ShopNowContents.jsx | 3 +- 2 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 com.twin.app.shoptime/.docs/player-panel/TabContainerV2-Divider-Problem-Analysis.md diff --git a/com.twin.app.shoptime/.docs/player-panel/TabContainerV2-Divider-Problem-Analysis.md b/com.twin.app.shoptime/.docs/player-panel/TabContainerV2-Divider-Problem-Analysis.md new file mode 100644 index 00000000..85ce3586 --- /dev/null +++ b/com.twin.app.shoptime/.docs/player-panel/TabContainerV2-Divider-Problem-Analysis.md @@ -0,0 +1,175 @@ +# TabContainerV2 ๊ตฌ๋ถ„์„  ๋ฌธ์ œ ๋ถ„์„ ๋ฐ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ + +## ๋ฌธ์ œ ๊ฐœ์š” + +PlayerPanel์˜ TabContainerV2์—์„œ ShopNowContents์™€ YouMayLikeContents ์‚ฌ์ด์— ์„ธ๋กœ ๊ตฌ๋ถ„์„ ์„ ํ‘œ์‹œํ•ด์•ผ ํ•˜์ง€๋งŒ, ํ˜„์žฌ TVirtualGridList ๊ตฌ์กฐ์˜ ํ•œ๊ณ„๋กœ ์ธํ•ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋™์ž‘ํ•˜์ง€ ์•Š์Œ + +## ํ˜„์žฌ ๊ตฌ์กฐ ๋ถ„์„ + +### 1. TabContainerV2 ๊ตฌ์กฐ +- ์œ„์น˜: `src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx` +- 3๊ฐœ์˜ tabIndex๋กœ ๊ตฌ์„ฑ (0: ShopNow, 1: LiveChannel, 2: ShopNowButton) +- version=2์—์„œ ShopNow์™€ YouMayLike ํ†ตํ•ฉ ํ‘œ์‹œ + +### 2. ShopNowContents ๊ตฌ์กฐ +- ์œ„์น˜: `src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx` +- ShopNow ์•„์ดํ…œ < 3๊ฐœ์ผ ๋•Œ YouMayLike ์•„์ดํ…œ์„ ํ†ตํ•ฉํ•˜์—ฌ ํ‘œ์‹œ +- combinedItems ๋ฐฐ์—ด๋กœ ShopNow + YouMayLike ํ†ตํ•ฉ ๊ด€๋ฆฌ +- TVirtualGridList๋กœ ๊ฐ€๋กœ ๋ฐฉํ–ฅ ๋ Œ๋”๋ง (itemWidth: 310px, itemHeight: 445px, spacing: 30px) + +### 3. ํ˜„์žฌ ๊ตฌ๋ถ„์„  ๊ตฌํ˜„ ๋กœ์ง +```javascript +// YouMayLike ์‹œ์ž‘ ์ง€์  ์—ฌ๋ถ€ (๊ตฌ๋ถ„์„  ํ‘œ์‹œ) +const isYouMayLikeStart = shopNowInfo && index === shopNowInfo.length; + +return ( + <> + {isYouMayLikeStart &&
} + + +); +``` + +## ๋ฌธ์ œ ์ƒ์„ธ + +### 1. TVirtualGridList ๊ตฌ์กฐ์  ํ•œ๊ณ„ +- TVirtualGridList๋Š” ๊ฐ ์•„์ดํ…œ์ด ๊ณ ์ •๋œ ํฌ๊ธฐ๋ฅผ ๊ฐ€์ง (itemWidth: 310px) +- renderItem ํ•จ์ˆ˜ ๋‚ด์—์„œ ์ถ”๊ฐ€์ ์ธ ์š”์†Œ(divider)๋ฅผ ๋ Œ๋”๋งํ•˜๋ฉด ๋ ˆ์ด์•„์›ƒ ์ถฉ๋Œ ๋ฐœ์ƒ +- divider๊ฐ€ TItemCard์™€ ๊ฐ™์€ ๊ณต๊ฐ„์„ ์ฐจ์ง€ํ•˜๋ ค๊ณ  ํ•˜์—ฌ ๋นˆ TItemCard๊ฐ€ ํ‘œ์‹œ๋˜๋Š” ํ˜„์ƒ + +### 2. ํฌ์ปค์Šค ์ด๋™ ๋ฌธ์ œ +- divider๊ฐ€ ํฌ์ปค์Šค๋ฅผ ๋ฐ›๊ฑฐ๋‚˜ ํฌ์ปค์Šค ์ด๋™์„ ๋ฐฉํ•ดํ•˜๋Š” ํ˜„์ƒ +- ์‹ค์ œ ์ƒํ’ˆ๊ณผ ํฌ์ปค์Šค ์œ„์น˜๊ฐ€ ๋ถˆ์ผ์น˜ํ•˜๋Š” ๋ฌธ์ œ + +### 3. ๊ฐ„๊ฒฉ ๋ฌธ์ œ +- ๊ตฌ๋ถ„์„ ์œผ๋กœ ์ธํ•ด ์ƒํ’ˆ๋“ค ๊ฐ„์˜ ๊ฐ„๊ฒฉ์ด ๋„“์–ด์ง +- ์‚ฌ์šฉ์ž ๊ฒฝํ—˜ ์ €ํ•˜ + +## ํ•ด๊ฒฐ ๋ฐฉ์•ˆ ๋ถ„์„ + +### ๋ฐฉ์•ˆ 1: TItemCard Wrapper ๋ฐฉ์‹ โŒ +**๊ตฌํ˜„:** +```javascript +
+ +
+``` + +**CSS:** +```css +.itemWrapper::before { + content: ''; + width: 2px; + opacity: 0; +} + +.itemWrapper.showDivider::before { + opacity: 1; + background: rgba(234, 234, 234, 0.3); +} +``` + +**๋ฌธ์ œ์ :** +- itemWidth๋ฅผ 310px โ†’ 327px๋กœ ์ฆ๊ฐ€์‹œ์ผœ์•ผ ํ•จ +- ์ƒํ’ˆ ๊ฐ„ ๊ฐ„๊ฒฉ์ด ๋„“์–ด์ง +- ํฌ์ปค์Šค์™€ ์ƒํ’ˆ ์œ„์น˜ ๋ถˆ์ผ์น˜ +- ์ „์ฒด ๋ ˆ์ด์•„์›ƒ ๋ณ€๊ฒฝ ํ•„์š” + +### ๋ฐฉ์•ˆ 2: Divider ์•„์ดํ…œ ์ถ”๊ฐ€ ๋ฐฉ์‹ โŒ +**๊ตฌํ˜„:** +```javascript +// combinedItems์— divider ์ถ”๊ฐ€ +items.push({ _type: 'divider' }); + +// renderItem์—์„œ ์ฒ˜๋ฆฌ +if (item._type === 'divider') { + return
; +} +``` + +**๋ฌธ์ œ์ :** +- divider๊ฐ€ TVirtualGridList ์•„์ดํ…œ์œผ๋กœ ์ธ์‹๋˜์–ด TItemCard๋งŒํผ ๊ณต๊ฐ„ ์ฐจ์ง€ +- ShopNow์™€ YouMayLike ์‚ฌ์ด ํฌ์ปค์Šค ์ด๋™์ด ๋ง‰ํž˜ +- ๋นˆ ๊ณต๊ฐ„์ด ์ƒ๊ธฐ๋Š” ๋ฌธ์ œ ์—ฌ์ „ํžˆ ์กด์žฌ + +### ๋ฐฉ์•ˆ 3: ๋‘ ๊ฐœ์˜ TVirtualGridList ๋ถ„๋ฆฌ ๋ฐฉ์‹ โœ… +**๊ตฌํ˜„:** +```javascript +
+ + [ShopNow1][ShopNow2] + +
+ +
+
+
+ +
+ + [YouMayLike1][YouMayLike2] + +
+``` + +**์žฅ์ :** +- ๊ตฌ๋ถ„์„ ์„ ์™„๋ฒฝํ•˜๊ฒŒ ์ œ์–ด ๊ฐ€๋Šฅ +- ๊ฐ TVirtualGridList๊ฐ€ ๋…๋ฆฝ์ ์œผ๋กœ ๋™์ž‘ +- ๋นˆ TItemCard ๋ฌธ์ œ ํ•ด๊ฒฐ +- ๋ ˆ์ด์•„์›ƒ ๊นจ์ง ์—†์Œ +- ๊ธฐ์กด ๊ธฐ๋Šฅ ๋ชจ๋‘ ์œ ์ง€ ๊ฐ€๋Šฅ + +**๊ณ ๋ ค์‚ฌํ•ญ:** +- ํฌ์ปค์Šค ์ด๋™ ํ•ธ๋“ค๋Ÿฌ ๊ตฌํ˜„ ํ•„์š” + - ShopNow ๋งˆ์ง€๋ง‰ ์•„์ดํ…œ โ†’ ๊ตฌ๋ถ„์„  โ†’ YouMayLike ์ฒซ ์•„์ดํ…œ + - YouMayLike ์ฒซ ์•„์ดํ…œ โ†’ ๊ตฌ๋ถ„์„  โ†’ ShopNow ๋งˆ์ง€๋ง‰ ์•„์ดํ…œ +- Spotlight ์ปจํ…Œ์ด๋„ˆ ๊ฐ„ ์ด๋™ ์ˆ˜๋™ ์ฒ˜๋ฆฌ ํ•„์š” + +**ํฌ์ปค์Šค ์ด๋™ ๊ตฌํ˜„ ์˜ˆ์‹œ:** +```javascript +// ShopNow ๋งˆ์ง€๋ง‰ ์•„์ดํ…œ +onSpotlightRight={() => Spotlight.focus('divider-element')} + +// ๊ตฌ๋ถ„์„  SpottableDiv + Spotlight.focus('shop-now-last')} + onSpotlightRight={() => Spotlight.focus('you-may-like-first')} +> +
+ + +// YouMayLike ์ฒซ ์•„์ดํ…œ +onSpotlightLeft={() => Spotlight.focus('divider-element')} +``` + +## ์ถ”์ฒœ ํ•ด๊ฒฐ์ฑ… + +**๋ฐฉ์•ˆ 3: ๋‘ ๊ฐœ์˜ TVirtualGridList ๋ถ„๋ฆฌ ๋ฐฉ์‹**์„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค. + +### ์ด์œ  +1. **๊ทผ๋ณธ์ ์ธ ํ•ด๊ฒฐ**: TVirtualGridList ๊ตฌ์กฐ์  ํ•œ๊ณ„๋ฅผ ์™„์ „ํžˆ ํšŒํ”ผ +2. **๋ ˆ์ด์•„์›ƒ ์•ˆ์ •์„ฑ**: ๊ฐ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋…๋ฆฝ์ ์œผ๋กœ ๋™์ž‘ํ•˜์—ฌ ์˜ˆ์ธก ๊ฐ€๋Šฅํ•œ ๊ฒฐ๊ณผ +3. **์œ ์ง€๋ณด์ˆ˜์„ฑ**: ๊ธฐ์กด ๋กœ์ง์„ ์ตœ์†Œํ•œ๋งŒ ์ˆ˜์ •ํ•˜๋ฉฐ ๋ช…ํ™•ํ•œ ๋ถ„๋ฆฌ +4. **์‚ฌ์šฉ์ž ๊ฒฝํ—˜**: ํฌ์ปค์Šค ์ด๋™์ด ๋” ๋ช…ํ™•ํ•˜๊ณ  ์ง๊ด€์  + +### ๊ตฌํ˜„ ์šฐ์„ ์ˆœ์œ„ +1. ShopNow TVirtualGridList ๋ถ„๋ฆฌ +2. YouMayLike TVirtualGridList ๋ถ„๋ฆฌ +3. ๊ตฌ๋ถ„์„  SpottableDiv ์ถ”๊ฐ€ +4. ํฌ์ปค์Šค ์ด๋™ ํ•ธ๋“ค๋Ÿฌ ๊ตฌํ˜„ +5. ํ…Œ์ŠคํŠธ ๋ฐ ๋””๋ฒ„๊น… + +### ์˜ํ–ฅ ๋ฒ”์œ„ +- **์ˆ˜์ • ํ•„์š” ํŒŒ์ผ**: `ShopNowContents.jsx` 1๊ฐœ +- **๊ธฐ์กด ๊ธฐ๋Šฅ**: ๋ชจ๋‘ ์œ ์ง€ ๊ฐ€๋Šฅ +- **์„ฑ๋Šฅ ์˜ํ–ฅ**: ๋ฏธ๋ฏธ (VirtualGridList ์ธ์Šคํ„ด์Šค 1๊ฐœ ์ถ”๊ฐ€) +- **์‚ฌ์šฉ์ž ์˜ํ–ฅ**: ์—†์Œ (๊ฐœ์„ ๋œ ๊ฒฝํ—˜ ์ œ๊ณต) + +## ๊ด€๋ จ ํŒŒ์ผ + +- `src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx` +- `src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx` +- `src/views/PlayerPanel/PlayerTabContents/TabContents/YouMayLikeContents.jsx` +- `src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.v2.module.less` +- `src/components/TVirtualGridList/TVirtualGridList.jsx` \ No newline at end of file diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx index 57bd741a..95521275 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx @@ -1,5 +1,6 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import classNames from 'classnames'; import { useDispatch, useSelector } from 'react-redux'; import { Job } from '@enact/core/util'; @@ -160,7 +161,7 @@ export default function ShopNowContents({ return ( <> - {isYouMayLikeStart &&
} + {/* {isYouMayLikeStart &&
} */}