TPopUp 스타일 추가, optionPopup 작업 중

This commit is contained in:
jiwon93.son
2024-01-29 13:36:14 +09:00
parent 1cdd305772
commit 47b465d182
4 changed files with 80 additions and 26 deletions

View File

@@ -15,9 +15,10 @@ const Container = SpotlightContainerDecorator(
{ enterTo: "default-element", preserveId: true }, { enterTo: "default-element", preserveId: true },
Spottable("div") Spottable("div")
); );
const SpottableComponent = Spottable("div");
const KINDS = ["textPopup", "termsPopup", "introTermsPopup"]; const SpottableComponent = Spottable("li");
const KINDS = ["textPopup", "termsPopup", "introTermsPopup", "optionPopup"];
export default function TPopUp({ export default function TPopUp({
kind, kind,
@@ -32,6 +33,9 @@ export default function TPopUp({
open, open,
title, title,
text, text,
options,
selectedOptionIdx,
setSelectedOptionIdx,
}) { }) {
useEffect(() => { useEffect(() => {
if (KINDS.indexOf(kind) < 0) { if (KINDS.indexOf(kind) < 0) {
@@ -42,6 +46,9 @@ export default function TPopUp({
useEffect(() => { useEffect(() => {
Spotlight.focus("tPopupBtn1"); Spotlight.focus("tPopupBtn1");
Spotlight.focus("tPopupBtn2"); Spotlight.focus("tPopupBtn2");
// TODO
// console.log("selectedOptionIndex", selectedOptionIndex);
// if (options) Spotlight.focus(`option_1`);
}, []); }, []);
const _onClose = useCallback( const _onClose = useCallback(
@@ -53,6 +60,11 @@ export default function TPopUp({
[onClose] [onClose]
); );
const handleOptionClick = useCallback((index) => {
setSelectedOptionIdx(index);
_onClose();
}, []);
return ( return (
<Alert <Alert
open={open} open={open}
@@ -75,6 +87,21 @@ export default function TPopUp({
{text && <div className={css.text}>{text}</div>} {text && <div className={css.text}>{text}</div>}
</div> </div>
)} )}
{options && (
<ul className={css.optionLayer}>
{options.map((option, index) => (
<SpottableComponent
className={css.option}
spotlightId={`option_${index}`}
onClick={() => {
handleOptionClick(index);
}}
>
{$L(option.prodOptCval)}
</SpottableComponent>
))}
</ul>
)}
{children} {children}
{hasButton && ( {hasButton && (
<div className={css.buttonContainer}> <div className={css.buttonContainer}>

View File

@@ -30,7 +30,7 @@
.default-style() { .default-style() {
.info { .info {
width: 780px; width: 780px;
background-color: @COLOR_WHITE; background-color: @BG_COLOR_01;
color: @COLOR_GRAY03; color: @COLOR_GRAY03;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -46,6 +46,7 @@
text-align: left; text-align: left;
font-size: 36px; font-size: 36px;
font-family: @baseFontBold; font-family: @baseFontBold;
line-height: normal;
color: @COLOR_BLACK; color: @COLOR_BLACK;
background-color: @COLOR_SKYBLUE; background-color: @COLOR_SKYBLUE;
padding: 30px 60px; padding: 30px 60px;
@@ -55,7 +56,8 @@
min-height: 180px; min-height: 180px;
color: @COLOR_GRAY03; color: @COLOR_GRAY03;
font-size: 30px; font-size: 30px;
padding: 30px 60px; line-height: 38px;
text-align: center;
.flex(); .flex();
} }
} }
@@ -66,24 +68,16 @@
.info { .info {
width: 1066px; width: 1066px;
height: 742px;
background-color: @COLOR_SKYBLUE; background-color: @COLOR_SKYBLUE;
padding: 60px; padding: 60px;
.textLayer {
.title {
}
.text {
}
}
.buttonContainer { .buttonContainer {
margin: 30px 0 0 0; margin: 30px 0 0 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
} }
.title { .title {
width: 100%; width: 100%;
} }
@@ -93,19 +87,49 @@
.default-style(); .default-style();
.info { .info {
.textLayer {
.title {
}
.text {
}
}
.buttonContainer { .buttonContainer {
margin: 30px 0; margin: 0 0 30px 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 12px; gap: 12px;
} }
} }
} }
.optionPopup {
.default-style();
.info {
width: 820px;
}
.optionLayer {
padding: 30px 60px;
li:not(:last-child) {
border-bottom: none;
}
.option {
background: @COLOR_WHITE;
font-size: 24px;
color: @COLOR_GRAY03;
padding: 30px;
border: 1px solid @COLOR_GRAY02;
height: 90px;
line-height: normal;
&:focus-within,
&:hover,
&:focus {
background: @PRIMARY_COLOR_RED;
color: @COLOR_WHITE;
}
}
}
.buttonContainer {
margin: 0 0 30px 0;
display: flex;
justify-content: center;
gap: 12px;
}
}

View File

@@ -75,7 +75,8 @@ export default function IntroPanel({ children, ...rest }) {
<div className={css.title}> <div className={css.title}>
{$L(`Welcome to `)} {$L(`Welcome to `)}
<span className={css.txtPoint}> <span className={css.txtPoint}>
Sh<span className={css.pointColor}>{$L("o")}</span> {$L("Sh")}
<span className={css.pointColor}>{$L("o")}</span>
{$L(`p Time !`)} {$L(`p Time !`)}
</span> </span>
</div> </div>

View File

@@ -49,17 +49,19 @@
.introTermsConts { .introTermsConts {
background-color: @COLOR_WHITE; background-color: @COLOR_WHITE;
font-size: 30px; font-size: 30px;
border: 1px solid @COLOR_GRAY01; border: 1px solid @COLOR_GRAY02;
color: @COLOR_BLACK; color: @COLOR_BLACK;
border-radius: 4px; border-radius: 4px;
white-space: pre-wrap;
.termsTitle { .termsTitle {
font-family: @baseFontBold; font-family: @baseFontBold;
border-bottom: 1px solid @COLOR_GRAY07; border-bottom: 1px solid @COLOR_GRAY02;
padding: 20px 30px; padding: 20px 30px;
} }
.termsDesc { .termsDesc {
padding: 10px 30px; padding: 30px;
line-height: 50px;
} }
} }