|
@@ -22,28 +22,6 @@ const HomeProduct = () => {
|
|
|
getAreaMutation.mutate();
|
|
getAreaMutation.mutate();
|
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
|
|
- // const { data: loadArea = [] } = useQuery<Area[]>({
|
|
|
|
|
- // queryKey: [DataCacheKey.AREAS],
|
|
|
|
|
- // queryFn: async (): Promise<Area[]> => {
|
|
|
|
|
- // try {
|
|
|
|
|
- // dispatch(startLoading({}));
|
|
|
|
|
- // const res = await productApi.loadArea({
|
|
|
|
|
- // isCountry: "-1",
|
|
|
|
|
- // isPopular: "1",
|
|
|
|
|
- // });
|
|
|
|
|
- // // save to redux store
|
|
|
|
|
- // dispatch(setAreas(res.data as Area[]));
|
|
|
|
|
- // return res.data as Area[];
|
|
|
|
|
- // } catch (error) {
|
|
|
|
|
- // console.error(error);
|
|
|
|
|
- // return []; // 🔴 bắt buộc
|
|
|
|
|
- // } finally {
|
|
|
|
|
- // dispatch(stopLoading());
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
- // staleTime: staleTime,
|
|
|
|
|
- // });
|
|
|
|
|
-
|
|
|
|
|
const getAreaMutation = useMutation({
|
|
const getAreaMutation = useMutation({
|
|
|
mutationFn: async () => {
|
|
mutationFn: async () => {
|
|
|
dispatch(startLoading({}));
|
|
dispatch(startLoading({}));
|
|
@@ -65,7 +43,8 @@ const HomeProduct = () => {
|
|
|
console.log("Get area response data:", data);
|
|
console.log("Get area response data:", data);
|
|
|
if (data && data.errorCode === "0") {
|
|
if (data && data.errorCode === "0") {
|
|
|
console.log("Get area successful");
|
|
console.log("Get area successful");
|
|
|
- setAreasList(data.data as Area[]);
|
|
|
|
|
|
|
+ const areas = data.data as Area[];
|
|
|
|
|
+ setAreasList(areas.slice(0, 8));
|
|
|
} else {
|
|
} else {
|
|
|
console.error("Get area failed, no token received");
|
|
console.error("Get area failed, no token received");
|
|
|
}
|
|
}
|
|
@@ -159,6 +138,29 @@ const HomeProduct = () => {
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div className="max-w-7xl mx-auto flex flex-col items-center mt-16">
|
|
|
|
|
+ <button
|
|
|
|
|
+ className="flex items-center bg-gradient-to-r from-[#E21c34] to-[#500B28] p-2 pr-10 rounded-full shadow-xl hover:scale-105 transition-all"
|
|
|
|
|
+ onClick={() => navigate("/buy-sim")}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center text-slate-800">
|
|
|
|
|
+ <svg
|
|
|
|
|
+ className="w-8 h-8"
|
|
|
|
|
+ fill="none"
|
|
|
|
|
+ stroke="currentColor"
|
|
|
|
|
+ viewBox="0 0 24 24"
|
|
|
|
|
+ >
|
|
|
|
|
+ <path
|
|
|
|
|
+ strokeLinecap="round"
|
|
|
|
|
+ strokeLinejoin="round"
|
|
|
|
|
+ strokeWidth={2.5}
|
|
|
|
|
+ d="M17 8l4 4m0 0l-4 4m4-4H3"
|
|
|
|
|
+ />
|
|
|
|
|
+ </svg>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span className="ml-6 text-white text-2xl font-black">See More</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
</section>
|
|
</section>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|