detail add loading

This commit is contained in:
hyunwoo93.cha
2024-06-17 10:40:10 +09:00
parent 8e633de41e
commit 43acf07d48
3 changed files with 18 additions and 12 deletions

View File

@@ -46,7 +46,6 @@ import YouMayLike from "./YouMayLike/YouMayLike";
export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
const [lgCatCd, setLgCatCd] = useState("");
const [loading, setLoading] = useState(true);
const [selectedIndex, setSelectedIndex] = useState(0);
const productData = useSelector((state) => state.main.productData);
const themeData = useSelector((state) => state.home.productData);
@@ -259,16 +258,6 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
}
}, [dispatch, themeProductInfos, selectedIndex, hotelInfos]);
useEffect(() => {
dispatch(
changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } })
);
if (productData || hotelData || themeData) {
setLoading(false);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
}
}, [dispatch, productData, hotelData, themeData]);
useEffect(() => {
return () => {
dispatch(clearProductDetail());