Skip to content

Commit 592f6bd

Browse files
authored
Bounties feat: integrated ambassador dao (#2829)
* feat: integrated ambassador dao * feat: add ambassador DAO components and pages - Introduced new components for the ambassador DAO including buttons, modals, and UI elements. - Created multiple pages for the ambassador DAO, including profile, jobs, bounties, and onboarding. - Added API routes and services for handling user authentication and opportunity management. - Updated package.json to include new dependencies such as react-hot-toast and react-markdown. - Enhanced global styles and layout configurations for better UI consistency. This commit significantly expands the ambassador DAO functionality and improves user experience.
1 parent 4db83df commit 592f6bd

File tree

130 files changed

+23219
-1076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+23219
-1076
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"use client";
2+
import FullScreenLoader from "@/components/ambassador-dao/full-screen-loader";
3+
import { useFetchUserDataQuery } from "@/services/ambassador-dao/requests/auth";
4+
import { useRouter } from "next/navigation";
5+
import { useEffect } from "react";
6+
import toast from "react-hot-toast";
7+
8+
const GoogleCallbackRedirectPage = () => {
9+
const { data, isLoading } = useFetchUserDataQuery();
10+
const router = useRouter();
11+
12+
useEffect(() => {
13+
if (!isLoading && !data) {
14+
router.push("/ambassador-dao");
15+
} else if (!isLoading && data) {
16+
if (!data.role || !data.first_name || !data.username) {
17+
router.push("/ambassador-dao/onboard");
18+
} else {
19+
if (data.role === "SPONSOR") {
20+
router.push("/ambassador-dao/sponsor");
21+
} else {
22+
router.push("/ambassador-dao");
23+
}
24+
}
25+
}
26+
}, [data, isLoading, router]);
27+
28+
if (isLoading) {
29+
return <FullScreenLoader />;
30+
}
31+
return <FullScreenLoader />;
32+
};
33+
34+
export default GoogleCallbackRedirectPage;

0 commit comments

Comments
 (0)