From dbbd7114a21bdcb1e2e1048a8c8372ee48c5a016 Mon Sep 17 00:00:00 2001 From: optrader Date: Sat, 22 Nov 2025 22:11:22 +0900 Subject: [PATCH] [251122] fix: DetailPanel ThemeButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 22. 22:11:22 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 3๊ฐœ โ€ข ์ถ”๊ฐ€: +91์ค„ โ€ข ์‚ญ์ œ: -7์ค„ ๐Ÿ“ ์ถ”๊ฐ€๋œ ํŒŒ์ผ: + com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/heightCalculator.js ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx ~ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.module.less ๐Ÿ”ง ํ•จ์ˆ˜ ๋ณ€๊ฒฝ ๋‚ด์šฉ: ๐Ÿ“„ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx (javascript): ๐Ÿ”„ Modified: extractProductMeta() ๐Ÿ“„ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/heightCalculator.js (javascript): โœ… Added: handleResize() ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ํ•ต์‹ฌ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ๊ฐœ์„  --- .../ProductAllSection/ProductAllSection.jsx | 18 ++- .../ProductAllSection.module.less | 80 ++++++++++++- .../ProductAllSection/heightCalculator.js | 107 ++++++++++++++++++ 3 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/heightCalculator.js diff --git a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx index 7200a019..f0fb1959 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx @@ -15,6 +15,7 @@ import couponImg from '../../../../assets/images/icons/coupon.png'; // import Spottable from '@enact/spotlight/Spottable'; //image import arrowDown from '../../../../assets/images/icons/ic_arrow_down_3x_new.png'; +import arrowDownIcon from '../../../../assets/images/icons/ic-arrow-down.svg'; import indicatorDefaultImage from '../../../../assets/images/img-thumb-empty-144@3x.png'; import { setHidePopup, setShowPopup } from '../../../actions/commonActions.js'; import { @@ -1452,15 +1453,22 @@ export default function ProductAllSection({ })()} */} - {panelInfo && panelInfo.type === 'theme' && !openThemeItemOverlay && ( - +
- {$L('THEME ITEM')} - - )} +
{$L('THEME ITEM')}
+ +
+ + {/* )} */} div { .couponText { color: white !important; @@ -459,7 +459,7 @@ color: white !important; font-size: 25px !important; font-family: @baseFont !important; - font-weight: 400 !important; + font-weight: 400 !important; text-align: center !important; } .buttonImg { @@ -661,6 +661,24 @@ } } +// Theme Item Button์„ ์œ„ํ•œ ์ƒˆ๋กœ์šด Wrapper +.bottomButtonWrapper { + position: absolute; + bottom: 40px; // ๋ฐ”๋‹ฅ์—์„œ 40px ๋งˆ์ง„ + left: 60px; // ์™ผ์ชฝ์—์„œ 60px + width: 635px; // ๊ณ ์ • ๋„ˆ๋น„ + min-width: 13.5rem; // ์ตœ์†Œ ๋„ˆ๋น„ + max-width: 27.08333rem; // ์ตœ๋Œ€ ๋„ˆ๋น„ + letter-spacing: -0.75px; // ์ž๊ฐ„ ์กฐ์ • + + > * { + margin-bottom: 5px; + &:last-child { + margin-bottom: 0; + } + } +} + .productDetailsButton, .userReviewsButton, .youMayLikeButton { @@ -689,6 +707,64 @@ } } +.productDetailsButton, +.userReviewsButton, +.youMayLikeButton { + align-self: stretch; + height: 60px; + background: rgba(255, 255, 255, 0.05); // ๊ธฐ๋ณธ ํšŒ์ƒ‰ ๋ฐฐ๊ฒฝ + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + + color: #eaeaea; + font-size: 25px; + font-family: @baseFont; // LG Smart ํฐํŠธ ์‚ฌ์šฉ + font-weight: 400; // Bold์—์„œ Regular๋กœ ๋ณ€๊ฒฝ + line-height: 35px; + + &:focus { + background: @PRIMARY_COLOR_RED; // ํฌ์ปค์Šค์‹œ๋งŒ ๋นจ๊ฐ„์ƒ‰ + } + + &.active { + border: 4px solid #4f172c; + background: #4f172c; + } +} + +.themeButton { + width: 100%; + height: 60px; + padding: 20px 30px; + background: rgba(255, 255, 255, 0.05); + overflow: hidden; + border-radius: 6px; + justify-content: center; + align-items: center; + gap: 15px; + display: inline-flex; + + color: white; + font-size: 25px; + font-family: @baseFont; // LG Smart UI + font-weight: 600; + line-height: 35px; + word-wrap: break-word; + + &:focus { + background: @PRIMARY_COLOR_RED; + } +} + +.themeButtonIcon { + width: 52.5px; + height: 31.25px; + object-fit: contain; +} + .addToCartButton { flex: 1 1 0% !important; width: auto !important; diff --git a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/heightCalculator.js b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/heightCalculator.js new file mode 100644 index 00000000..711c6878 --- /dev/null +++ b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/heightCalculator.js @@ -0,0 +1,107 @@ +// InfoSection ๋†’์ด ์ธก์ •์„ ์œ„ํ•œ ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜ + +// InfoSection ๋‚ด๋ถ€ ์š”์†Œ๋“ค์˜ ๋†’์ด๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ํ•จ์ˆ˜ +export const calculateInfoSectionHeight = (infoSectionElement) => { + if (!infoSectionElement) { + console.error('InfoSection element not found'); + return null; + } + + const result = { + // ์ „์ฒด InfoSection ๋†’์ด + totalHeight: infoSectionElement.offsetHeight || infoSectionElement.clientHeight, + + // ๋‚ด๋ถ€ ์š”์†Œ๋“ค์˜ ๋†’์ด + elements: {}, + }; + + // ์ฃผ์š” ์š”์†Œ๋“ค์˜ ๋†’์ด ์ธก์ • + const selectors = [ + '.leftInfoContainer', // ์ „์ฒด ์™ผ์ชฝ ์ปจํ…Œ์ด๋„ˆ + '.leftInfoWrapper', // ๋‚ด๋ถ€ ๋ž˜ํผ + '.headerContent', // ํ—ค๋” ์ฝ˜ํ…์ธ  (ํƒœ๊ทธ, ๋ณ„์ ) + '.productOverview', // ์ œํ’ˆ ๊ฐœ์š” + '.qrWrapper', // QR ์ฝ”๋“œ + '.buttonStackContainer', // ๋ฒ„ํŠผ ์Šคํƒ ์ปจํ…Œ์ด๋„ˆ + '.couponStackContainer', // ์ฟ ํฐ ์Šคํƒ (์žˆ์„ ๊ฒฝ์šฐ) + '.buyNowCartContainer', // BUY NOW + ADD TO CART (์žˆ์„ ๊ฒฝ์šฐ) + '.buttonContainer', // SHOP BY MOBILE (์žˆ์„ ๊ฒฝ์šฐ) + '.callToOrderSection', // ์ „ํ™” ์ฃผ๋ฌธ ์„น์…˜ + '.actionButtonsWrapper', // PRODUCT DETAILS, USER REVIEWS, YOU MAY ALSO LIKE + '.themeButton', // THEME ITEM ๋ฒ„ํŠผ + '.DetailMobileSendPopUp', // ๋ชจ๋ฐ”์ผ ์ „์†ก ํŒ์—… + ]; + + selectors.forEach((selector) => { + const element = infoSectionElement.querySelector(selector); + if (element) { + result.elements[selector] = { + height: element.offsetHeight, + clientHeight: element.clientHeight, + scrollHeight: element.scrollHeight, + marginTop: parseInt(window.getComputedStyle(element).marginTop) || 0, + marginBottom: parseInt(window.getComputedStyle(element).marginBottom) || 0, + paddingTop: parseInt(window.getComputedStyle(element).paddingTop) || 0, + paddingBottom: parseInt(window.getComputedStyle(element).paddingBottom) || 0, + isVisible: element.offsetParent !== null, + }; + } + }); + + // ์‹ค์ œ ์‚ฌ์šฉ๋œ ๋†’์ด ๊ณ„์‚ฐ + const calculatedHeight = Object.values(result.elements).reduce((total, element) => { + if (element && element.isVisible) { + return total + element.height + element.marginTop + element.marginBottom; + } + return total; + }, 0); + + result.calculatedHeight = calculatedHeight; + result.remainingSpace = result.totalHeight - calculatedHeight; + result.isOverflowing = calculatedHeight > result.totalHeight; + + return result; +}; + +// React Hook์œผ๋กœ ๋งŒ๋“  ๋ฒ„์ „ +export const useInfoSectionHeight = (infoSectionRef) => { + const [heightInfo, setHeightInfo] = useState(null); + + const measureHeight = useCallback(() => { + if (infoSectionRef.current) { + const info = calculateInfoSectionHeight(infoSectionRef.current); + setHeightInfo(info); + console.log('InfoSection Height Info:', info); + return info; + } + }, [infoSectionRef]); + + // ์ปดํฌ๋„ŒํŠธ ๋งˆ์šดํŠธ ์‹œ ์ธก์ • + useEffect(() => { + measureHeight(); + }, [measureHeight]); + + // ์œˆ๋„์šฐ ๋ฆฌ์‚ฌ์ด์ฆˆ ์‹œ ์žฌ์ธก์ • (์„ ํƒ์‚ฌํ•ญ) + useEffect(() => { + const handleResize = () => { + measureHeight(); + }; + + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, [measureHeight]); + + return { + heightInfo, + measureHeight, + }; +}; + +// ์‚ฌ์šฉ ์˜ˆ์‹œ: +// const infoSectionRef = useRef(null); +// const { heightInfo, measureHeight } = useInfoSectionHeight(infoSectionRef); +// +// // JSX์—์„œ +//
+// ... content ... +//