[TPopUp] 부분 수정, 스타일 및 props 추가
This commit is contained in:
@@ -34,8 +34,10 @@ export default function TPopUp({
|
|||||||
title,
|
title,
|
||||||
text,
|
text,
|
||||||
options,
|
options,
|
||||||
|
useOptionImg,
|
||||||
selectedOptionIdx,
|
selectedOptionIdx,
|
||||||
setSelectedOptionIdx,
|
setSelectedOptionIdx,
|
||||||
|
...rest
|
||||||
}) {
|
}) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (KINDS.indexOf(kind) < 0) {
|
if (KINDS.indexOf(kind) < 0) {
|
||||||
@@ -47,8 +49,7 @@ export default function TPopUp({
|
|||||||
Spotlight.focus("tPopupBtn1");
|
Spotlight.focus("tPopupBtn1");
|
||||||
Spotlight.focus("tPopupBtn2");
|
Spotlight.focus("tPopupBtn2");
|
||||||
// TODO
|
// TODO
|
||||||
// console.log("selectedOptionIndex", selectedOptionIndex);
|
// if (options) Spotlight.focus(`option_${selectedOptionIdx}`)
|
||||||
// if (options) Spotlight.focus(`option_1`);
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const _onClose = useCallback(
|
const _onClose = useCallback(
|
||||||
@@ -88,15 +89,34 @@ export default function TPopUp({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{options && (
|
{options && (
|
||||||
<ul className={css.optionLayer}>
|
<ul
|
||||||
|
className={classNames(
|
||||||
|
css.optionLayer,
|
||||||
|
options.length >= 5 ? css.optionScroll : null
|
||||||
|
)}
|
||||||
|
>
|
||||||
{options.map((option, index) => (
|
{options.map((option, index) => (
|
||||||
<SpottableComponent
|
<SpottableComponent
|
||||||
className={css.option}
|
{...rest}
|
||||||
spotlightId={`option_${index}`}
|
className={classNames(
|
||||||
|
css.option,
|
||||||
|
index === selectedOptionIdx ? css.selectedOption : null
|
||||||
|
)}
|
||||||
|
spotlightId={
|
||||||
|
index === selectedOptionIdx ? `option_${index}` : null
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleOptionClick(index);
|
handleOptionClick(index);
|
||||||
}}
|
}}
|
||||||
|
key={index}
|
||||||
>
|
>
|
||||||
|
{useOptionImg && (
|
||||||
|
<img
|
||||||
|
src={option.optImgUrl}
|
||||||
|
alt="option_img"
|
||||||
|
className={css.img}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{$L(option.prodOptCval)}
|
{$L(option.prodOptCval)}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -103,10 +103,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.optionLayer {
|
.optionLayer {
|
||||||
padding: 30px 60px;
|
margin: 0 auto;
|
||||||
|
width: 700px;
|
||||||
|
max-height: 410px;
|
||||||
|
border-top: 1px solid @COLOR_GRAY02;
|
||||||
|
border-bottom: 1px solid @COLOR_GRAY02;
|
||||||
|
|
||||||
li:not(:last-child) {
|
li:not(:first-child) {
|
||||||
border-bottom: none;
|
border-top: 1px solid @COLOR_GRAY02;
|
||||||
}
|
}
|
||||||
|
|
||||||
.option {
|
.option {
|
||||||
@@ -114,9 +118,12 @@
|
|||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: @COLOR_GRAY03;
|
color: @COLOR_GRAY03;
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
border: 1px solid @COLOR_GRAY02;
|
border-right: 1px solid @COLOR_GRAY02;
|
||||||
|
border-left: 1px solid @COLOR_GRAY02;
|
||||||
height: 90px;
|
height: 90px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
&:focus-within,
|
&:focus-within,
|
||||||
&:hover,
|
&:hover,
|
||||||
@@ -124,10 +131,23 @@
|
|||||||
background: @PRIMARY_COLOR_RED;
|
background: @PRIMARY_COLOR_RED;
|
||||||
color: @COLOR_WHITE;
|
color: @COLOR_WHITE;
|
||||||
}
|
}
|
||||||
|
.img {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin: 0 12px 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.optionScroll {
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.selectedOption {
|
||||||
|
background: @SELECTED_COLOR_RED;
|
||||||
|
color: @COLOR_WHITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.buttonContainer {
|
.buttonContainer {
|
||||||
margin: 0 0 30px 0;
|
margin: 30px 0 30px 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|||||||
Reference in New Issue
Block a user