Loading web/src/domain/useCase/useAdminTownInfo.ts +10 −13 Original line number Diff line number Diff line Loading @@ -5,15 +5,14 @@ import { useGetStatesList } from "./useGetStatesList"; // Custom hook for managing town information in admin panel export const useAdminTownInfo = (updateTown: () => void) => { const [isEnglish, setIsEnglish] = useState(false); const [isLoading, setIsLoading] = useState(true); const [renderCount, setRenderCount] = useState(0); const { getStates, statesList } = useGetStatesList(); // Function to force re-render the list const forceRenderList = () => { updateTown(); setRenderCount(prevCount => prevCount + 1); } setRenderCount((prevCount) => prevCount + 1); }; // Fetch states on component mount useEffect(() => { Loading @@ -23,11 +22,9 @@ export const useAdminTownInfo = (updateTown: ()=>void) => { return { isEnglish, isLoading, setIsEnglish, setIsLoading, forceRenderList, renderCount, statesList, } } No newline at end of file }; }; web/src/presentation/admin/admin_town_info/admin_town_info.tsx +7 −27 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ interface props { setIsWindowActive: Dispatch<SetStateAction<boolean>>; town: Town | undefined; updateTown: () => Promise<void>; isLoading: boolean; } // Main component function Loading @@ -21,17 +22,11 @@ export const AdminTownInfo = ({ isWindowActive, setIsWindowActive, town, isLoading, }: props) => { // Destructure values from the custom hook const { isEnglish, isLoading, setIsEnglish, setIsLoading, renderCount, forceRenderList, statesList, } = useAdminTownInfo(updateTown); const { isEnglish, setIsEnglish, renderCount, forceRenderList, statesList } = useAdminTownInfo(updateTown); // State to manage the visibility of the town register window const [isTownRegisterWindowActive, setIsTownRegisterWindowActive] = Loading Loading @@ -59,6 +54,8 @@ export const AdminTownInfo = ({ ); } if (isLoading) return <LoadingScreen />; // Main render of the component return ( <div className="town_info_root"> Loading @@ -73,29 +70,12 @@ export const AdminTownInfo = ({ /> )} <div className="town_info_cnt" key={renderCount}> {isLoading && ( <div style={{ width: "100%", height: "100%", background: "#eaeaea", position: "fixed", }} > <LoadingScreen /> </div> )} <div className="info_header"> <p>{town?.name}</p> </div> <div className="info_body"> <div className="town_image_cnt"> <img src={town?.imageURL as string} onLoad={() => setIsLoading(false)} alt="" /> <img src={town?.imageURL as string} alt="" /> </div> <div className="info_fields_cnt"> <div className="buttons_cnt"> Loading web/src/presentation/admin/panel/admin_home_page.tsx +1 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ export const AdminHomePage = () => { setIsWindowActive={setIsWindowActive} isWindowActive={isWindowActive} town={town} isLoading={isLoading} /> ); case AdminSelectedPanel.PLACES: Loading web/src/domain/useCase/useAdminHomePage.ts +1 −1 File changed.Contains only whitespace changes. Show changes Loading
web/src/domain/useCase/useAdminTownInfo.ts +10 −13 Original line number Diff line number Diff line Loading @@ -5,15 +5,14 @@ import { useGetStatesList } from "./useGetStatesList"; // Custom hook for managing town information in admin panel export const useAdminTownInfo = (updateTown: () => void) => { const [isEnglish, setIsEnglish] = useState(false); const [isLoading, setIsLoading] = useState(true); const [renderCount, setRenderCount] = useState(0); const { getStates, statesList } = useGetStatesList(); // Function to force re-render the list const forceRenderList = () => { updateTown(); setRenderCount(prevCount => prevCount + 1); } setRenderCount((prevCount) => prevCount + 1); }; // Fetch states on component mount useEffect(() => { Loading @@ -23,11 +22,9 @@ export const useAdminTownInfo = (updateTown: ()=>void) => { return { isEnglish, isLoading, setIsEnglish, setIsLoading, forceRenderList, renderCount, statesList, } } No newline at end of file }; };
web/src/presentation/admin/admin_town_info/admin_town_info.tsx +7 −27 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ interface props { setIsWindowActive: Dispatch<SetStateAction<boolean>>; town: Town | undefined; updateTown: () => Promise<void>; isLoading: boolean; } // Main component function Loading @@ -21,17 +22,11 @@ export const AdminTownInfo = ({ isWindowActive, setIsWindowActive, town, isLoading, }: props) => { // Destructure values from the custom hook const { isEnglish, isLoading, setIsEnglish, setIsLoading, renderCount, forceRenderList, statesList, } = useAdminTownInfo(updateTown); const { isEnglish, setIsEnglish, renderCount, forceRenderList, statesList } = useAdminTownInfo(updateTown); // State to manage the visibility of the town register window const [isTownRegisterWindowActive, setIsTownRegisterWindowActive] = Loading Loading @@ -59,6 +54,8 @@ export const AdminTownInfo = ({ ); } if (isLoading) return <LoadingScreen />; // Main render of the component return ( <div className="town_info_root"> Loading @@ -73,29 +70,12 @@ export const AdminTownInfo = ({ /> )} <div className="town_info_cnt" key={renderCount}> {isLoading && ( <div style={{ width: "100%", height: "100%", background: "#eaeaea", position: "fixed", }} > <LoadingScreen /> </div> )} <div className="info_header"> <p>{town?.name}</p> </div> <div className="info_body"> <div className="town_image_cnt"> <img src={town?.imageURL as string} onLoad={() => setIsLoading(false)} alt="" /> <img src={town?.imageURL as string} alt="" /> </div> <div className="info_fields_cnt"> <div className="buttons_cnt"> Loading
web/src/presentation/admin/panel/admin_home_page.tsx +1 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ export const AdminHomePage = () => { setIsWindowActive={setIsWindowActive} isWindowActive={isWindowActive} town={town} isLoading={isLoading} /> ); case AdminSelectedPanel.PLACES: Loading
web/src/domain/useCase/useAdminHomePage.ts +1 −1 File changed.Contains only whitespace changes. Show changes