add: more things

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-06 15:21:36 +08:00
parent 41e98bb602
commit 244aa607f7
71 changed files with 2998 additions and 1014 deletions
+18 -9
View File
@@ -207,7 +207,11 @@ const Client = () => {
const { courses, coursesLoading, getCourses } = useClientCourses();
const { myTier, getMyTier, tierMap } = useClientTiers();
const { groups, fetchGroups, loading: groupLoading } = useGroup();
const { advertisements, loading: adLoading, getActiveAdvertisements, handleAdCtaClick, dismissPopupForever } = useClientAdvertisements();
const {
advertisements, getActiveAdvertisements,
adLists, listLoading, getActiveAdvertisementList,
handleAdCtaClick, dismissPopupForever,
} = useClientAdvertisements();
const [modalOpen, setModalOpen] = useState(false);
const [selectedCourse, setSelectedCourse] = useState(null);
@@ -216,15 +220,19 @@ const Client = () => {
const userTier = myTier?.tier ?? "free";
const heroAd = advertisements["dashboard.hero"] ?? null;
const heroAds = adLists["dashboard.hero"] ?? [];
const popupAd = advertisements["dashboard.popup"] ?? null;
// Show welcome toast on first registration
useEffect(() => {
if (!navState?.justRegistered) return;
toast.success('Welcome to Philproperties!', {
toast('Welcome to Philproperties!', {
description: 'You earned the Early Access badge. Check your notifications for details.',
duration: 6000,
action: {
label: "Close",
onClick: () => {}
}
});
window.history.replaceState({}, '');
}, []);
@@ -238,11 +246,12 @@ const Client = () => {
fetchGroups();
}, [])
// ── Resolve active hero + popup ads once on mount ────────────────────────
// ── Resolve active popup ad + hero ad carousel once on mount ─────────────
useEffect(() => {
getActiveAdvertisements(["dashboard.hero", "dashboard.popup"]).then((result) => {
getActiveAdvertisements(["dashboard.popup"]).then((result) => {
if (result["dashboard.popup"]) setPopupOpen(true);
});
getActiveAdvertisementList("dashboard.hero");
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
@@ -268,13 +277,13 @@ const Client = () => {
return (
<div>
<div className="my-20">
<div className="flex flex-col gap-8 justify-between lg:container lg:mx-auto pt-8 px-16">
<div className="flex flex-col gap-8 justify-between lg:container lg:mx-auto xs:pt-2 lg:pt-8 lg:px-16 xs:px-4 sm:px-6">
{/* ── Hero Advertisement ── */}
{adLoading["dashboard.hero"] ? (
{/* ── Hero Advertisement Carousel ── */}
{listLoading["dashboard.hero"] ? (
<HeroSkeleton />
) : (
<Hero ad={heroAd} onCtaClick={handleAdCtaClick} />
<Hero ads={heroAds} onCtaClick={handleAdCtaClick} />
)}
{/* ── My Groups ── */}