[mypage]support 팝업부분 인디케이터 추가.

- 이미지 파일추가
 - Tpopup 파라미터 추가.
 - 서폿트 부분 데이터 불러오는곳 부분변경.
This commit is contained in:
junghoon86.park
2024-04-01 14:09:12 +09:00
parent 02661ed000
commit 82f25e4163
7 changed files with 87 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -21,6 +21,7 @@ const OptionContainer = SpotlightContainerDecorator(
); );
const SpottableComponent = Spottable("li"); const SpottableComponent = Spottable("li");
const SpottableDiv = Spottable("div");
const KINDS = [ const KINDS = [
"textPopup", "textPopup",
@@ -39,9 +40,15 @@ export default function TPopUp({
children, children,
onExit, onExit,
onClick, onClick,
currentPage,
onRightClick,
onLeftClick,
itemLength,
onClose, onClose,
hasButton, hasButton,
hasText, hasText,
hasIndicator,
className, className,
button1Text, button1Text,
button2Text, button2Text,
@@ -109,6 +116,23 @@ export default function TPopUp({
[_optionClick] [_optionClick]
); );
const _onLeftClick = useCallback(
(e) => {
if (onLeftClick) {
onLeftClick(e);
}
},
[onLeftClick]
);
const _onRightClick = useCallback(
(e) => {
if (onRightClick) {
onRightClick(e);
}
},
[onRightClick]
);
return ( return (
<Alert <Alert
open={open} open={open}
@@ -168,6 +192,22 @@ export default function TPopUp({
</OptionContainer> </OptionContainer>
)} )}
{children} {children}
{hasIndicator && (
<>
{currentPage !== 0 && (
<SpottableDiv
className={css.leftBtn}
onClick={_onLeftClick}
></SpottableDiv>
)}
{currentPage !== itemLength - 1 && (
<SpottableDiv
className={css.rightBtn}
onClick={_onRightClick}
></SpottableDiv>
)}
</>
)}
{hasButton && ( {hasButton && (
<div className={css.buttonContainer}> <div className={css.buttonContainer}>
{button1Text && ( {button1Text && (

View File

@@ -210,7 +210,7 @@
.supportPopup { .supportPopup {
.default-style(); .default-style();
position: relative;
.info { .info {
width: 1064px; width: 1064px;
height: 749px; height: 749px;
@@ -222,6 +222,28 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.leftBtn {
position: absolute;
left: 10px;
top: calc(50% - 52px);
width: 27px;
height: 52px;
background-image: url(../../../assets/images/MS-arr-l.png);
&:focus {
background-image: url(../../../assets/images/MS-arr-l-s.png);
}
}
.rightBtn {
position: absolute;
right: 10px;
top: calc(50% - 52px);
width: 27px;
height: 52px;
background-image: url(../../../assets/images/MS-arr-r.png);
&:focus {
background-image: url(../../../assets/images/MS-arr-r-s.png);
}
}
} }
.title { .title {
width: 100%; width: 100%;

View File

@@ -6,10 +6,10 @@ import Spottable from "@enact/spotlight/Spottable";
import Marquee from "@enact/ui/Marquee"; import Marquee from "@enact/ui/Marquee";
import { getMyFaqInfo, getNotice } from "../../../../../actions/myPageActions"; import { getMyFaqInfo, getNotice } from "../../../../../actions/myPageActions";
import TButtonScroller from "../../../../../components/TButtonScroller/TButtonScroller";
import TPopUp from "../../../../../components/TPopUp/TPopUp"; import TPopUp from "../../../../../components/TPopUp/TPopUp";
import TScroller from "../../../../../components/TScroller/TScroller"; import TScroller from "../../../../../components/TScroller/TScroller";
import css from "./ListContents.module.less"; import css from "./ListContents.module.less";
import TButtonScroller from "../../../../../components/TButtonScroller/TButtonScroller";
const SpottableComponent = Spottable("li"); const SpottableComponent = Spottable("li");
@@ -24,7 +24,7 @@ export default function ListContents({ selectedTab }) {
const [faqPopUpOpen, setFaqPopUpOpen] = useState(false); const [faqPopUpOpen, setFaqPopUpOpen] = useState(false);
const [currentInfos, setCurrentInfos] = useState(null); const [currentInfos, setCurrentInfos] = useState(null);
const [listInfos, setListInfos] = useState([]); const [listInfos, setListInfos] = useState([]);
const [openIdx, setOpenIdx] = useState(null);
useEffect(() => { useEffect(() => {
dispatch(getMyFaqInfo({})); dispatch(getMyFaqInfo({}));
dispatch(getNotice({})); dispatch(getNotice({}));
@@ -34,17 +34,30 @@ export default function ListContents({ selectedTab }) {
selectedTab === 0 ? setListInfos(faqInfos) : setListInfos(noticeInfos); selectedTab === 0 ? setListInfos(faqInfos) : setListInfos(noticeInfos);
}, [selectedTab, faqInfos, noticeInfos]); }, [selectedTab, faqInfos, noticeInfos]);
let selectedData = null;
const handleListClick = useCallback( const handleListClick = useCallback(
(notiNo) => { (idx) => {
if (listInfos) { if (listInfos) {
const selectedData = listInfos.find((list) => list.notiNo === notiNo); selectedData = listInfos[idx];
setCurrentInfos(selectedData); setOpenIdx(idx);
setFaqPopUpOpen(true); setFaqPopUpOpen(true);
} }
}, },
[listInfos, currentInfos, faqInfos, noticeInfos] [listInfos, currentInfos, faqInfos, noticeInfos]
); );
const onLeftClick = useCallback(() => {
if (openIdx !== 0) {
setOpenIdx((openIdx) => (openIdx > 0 ? openIdx - 1 : openIdx));
}
}, [openIdx, currentInfos, listInfos]);
const onRightClick = useCallback(() => {
setOpenIdx((openIdx) => openIdx + 1);
}, [openIdx, currentInfos, listInfos]);
useEffect(() => {
selectedData = listInfos[openIdx];
setCurrentInfos(selectedData);
}, [openIdx]);
return ( return (
<> <>
<TScroller className={css.scrollContainer} verticalScrollbar="visible"> <TScroller className={css.scrollContainer} verticalScrollbar="visible">
@@ -55,7 +68,7 @@ export default function ListContents({ selectedTab }) {
<SpottableComponent <SpottableComponent
key={`list:${idx}`} key={`list:${idx}`}
onClick={() => { onClick={() => {
handleListClick(list.notiNo); handleListClick(idx);
}} }}
> >
<Marquee className={css.marquee} marqueeOn="focus"> <Marquee className={css.marquee} marqueeOn="focus">
@@ -73,6 +86,11 @@ export default function ListContents({ selectedTab }) {
setFaqPopUpOpen(false); setFaqPopUpOpen(false);
}} }}
hasButton hasButton
hasIndicator
onLeftClick={onLeftClick}
onRightClick={onRightClick}
itemLength={listInfos?.length}
currentPage={openIdx}
button1Text="OK" button1Text="OK"
> >
{currentInfos && ( {currentInfos && (
@@ -99,4 +117,3 @@ export default function ListContents({ selectedTab }) {
</> </>
); );
} }
0;