Skip to content

Commit f21830f

Browse files
authored
Merge pull request #2952 from Luna-Exchange/insomnia/staging
Update configs and redirections.
2 parents 592f6bd + c68ff3c commit f21830f

File tree

11 files changed

+426
-327
lines changed

11 files changed

+426
-327
lines changed

app/(home)/ambassador-dao/onboard/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ const TalentForm = () => {
336336
},
337337
{
338338
onSuccess: () => {
339-
console.log("success");
340339
if (isEditProfilePage) {
341340
return;
342341
} else {

app/(home)/ambassador-dao/page.tsx

Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,113 @@ import { Suspense } from "react";
55
import Team1 from "@/public/ambassador-dao-images/Avalanche-team1.png";
66
import Team1Logo from "@/public/ambassador-dao-images/team1.svg";
77

8-
import React from "react";
8+
import React, { useState } from "react";
99

1010
import MainContent from "@/components/ambassador-dao/dashboard/MainContent";
1111
import { useFetchUserDataQuery } from "@/services/ambassador-dao/requests/auth";
1212
import FullScreenLoader from "@/components/ambassador-dao/full-screen-loader";
1313
import { AmbassadorCard } from "@/components/ambassador-dao/dashboard/SideContent";
14+
import { AuthModal } from "@/components/ambassador-dao/sections/auth-modal";
1415

1516
const WelcomeSection = ({ user }: { user: any }) => {
1617
return (
17-
<div className="relative bg-welcome overflow-hidden backdrop-blur-[200px] h-full max-h-[340px] sm:max-h-[256px] py-16">
18-
<div className="max-w-7xl mx-auto my-auto px-4 sm:px-6 lg:px-8 flex flex-col sm:flex-row sm:justify-between sm:items-center">
19-
<div className="relative z-10">
18+
<div className='relative bg-welcome overflow-hidden backdrop-blur-[200px] h-full max-h-[340px] sm:max-h-[256px] py-16'>
19+
<div className='max-w-7xl mx-auto my-auto px-4 sm:px-6 lg:px-8 flex flex-col sm:flex-row sm:justify-between sm:items-center'>
20+
<div className='relative z-10'>
2021
{user && (
2122
<>
22-
<h1 className="text-2xl sm:text-4xl font-normal text-[var(--white-text-color)] mb-2">
23+
<h1 className='text-2xl sm:text-4xl font-normal text-[var(--white-text-color)] mb-2'>
2324
Welcome back, {user?.first_name}
2425
</h1>
25-
<p className="text-md sm:text-xl text-[var(--secondary-text-color)]">
26+
<p className='text-md sm:text-xl text-[var(--secondary-text-color)]'>
2627
We're so glad to have you on Team 1
2728
</p>
2829
</>
2930
)}
3031

3132
{!user && (
3233
<>
33-
<h1 className="text-2xl sm:text-4xl text-[var(--white-text-color)] mb-2">
34+
<h1 className='text-2xl sm:text-4xl text-[var(--white-text-color)] mb-2'>
3435
Welcome to Team 1
3536
</h1>
36-
<p className="text-md sm:text-xl text-[var(--secondary-text-color)]">
37+
<p className='text-md sm:text-xl text-[var(--secondary-text-color)]'>
3738
Where talent connects with opportunity in the Avalanche
3839
ecosystem
3940
</p>
4041
</>
4142
)}
4243
</div>
43-
44-
<div className="flex mt-4 sm:mt-0 items-end justify-end">
45-
<div className="hidden dark:block">
46-
<Image
47-
src={Team1}
48-
alt="Avalanche Logo (Dark Mode)"
49-
className="h-full object-cover"
50-
width={110}
51-
height={115}
52-
/>
44+
{!user && (
45+
<div className='flex mt-4 sm:mt-0 items-end justify-end'>
46+
<div className='hidden dark:block'>
47+
<Image
48+
src={Team1}
49+
alt='Avalanche Logo (Dark Mode)'
50+
className='h-full object-cover'
51+
width={110}
52+
height={115}
53+
/>
54+
</div>
55+
<div className='block dark:hidden'>
56+
<Image
57+
src={Team1Logo}
58+
alt='Avalanche Logo (Light Mode)'
59+
className='h-full object-cover'
60+
width={110}
61+
height={115}
62+
/>
63+
</div>
5364
</div>
54-
<div className="block dark:hidden">
55-
<Image
56-
src={Team1Logo}
57-
alt="Avalanche Logo (Light Mode)"
58-
className="h-full object-cover"
59-
width={110}
60-
height={115}
61-
/>
62-
</div>
63-
</div>
65+
)}
6466
</div>
6567
</div>
6668
);
6769
};
6870

6971
const AmbasssadorDao = () => {
7072
const { data: user, isLoading } = useFetchUserDataQuery();
71-
73+
const [openAuthModal, setOpenAuthModal] = useState(false);
7274
if (isLoading) {
7375
return <FullScreenLoader />;
7476
}
7577

7678
return (
77-
<div className="bg-[#fff] dark:bg-[#000] text-[var(--white-text-color)] min-h-screen">
79+
<div className='bg-[#fff] dark:bg-[#000] text-[var(--white-text-color)] min-h-screen'>
7880
<WelcomeSection user={user} />
79-
<div className="max-w-[1220px] bg-[var(--drop-shadow)] mx-auto px-8 py-8 rounded-xl grid grid-cols-1 md:grid-cols-2 gap-4 -mt-8 shadow-sm backdrop-blur-xs border-[1px] border-[#FFFFFF66] dark:border-none">
80-
{user?.role !== "AMBASSADOR" && (
81-
<AmbassadorCard
82-
title="Become a Member"
83-
description="Reach 70,000+ talent from one single dashboard"
84-
link="/"
85-
/>
86-
)}
87-
{user?.role !== "AMBASSADOR" && (
88-
<AmbassadorCard
89-
title="Become a Client"
90-
description="Post projects and hire top talent for your business needs"
91-
link="/"
92-
/>
93-
)}
94-
</div>
81+
{!user && (
82+
<div className='max-w-[1220px] bg-[var(--drop-shadow)] mx-auto px-8 py-8 rounded-xl grid grid-cols-1 md:grid-cols-2 gap-4 -mt-8 shadow-sm backdrop-blur-xs border-[1px] border-[#FFFFFF66] dark:border-none'>
83+
{user?.role !== "AMBASSADOR" && (
84+
<AmbassadorCard
85+
title='Become a Member'
86+
description='Reach 70,000+ talent from one single dashboard'
87+
onClick={() =>
88+
window.open(
89+
"https://job-boards.greenhouse.io/avalabs",
90+
"_blank",
91+
"noopener,noreferrer"
92+
)
93+
}
94+
/>
95+
)}
96+
{user?.role !== "AMBASSADOR" && (
97+
<AmbassadorCard
98+
title='Become a Client'
99+
description='Post projects and hire top talent for your business needs'
100+
onClick={() => setOpenAuthModal(true)}
101+
/>
102+
)}
103+
</div>
104+
)}
95105

96-
<main className="max-w-7xl mx-auto px-4 sm:px-6 xl:px-8 py-12">
106+
<main className='max-w-7xl mx-auto px-4 sm:px-6 xl:px-8 py-12'>
97107
<Suspense fallback={<div>Loading...</div>}>
98108
<MainContent user={user} />
109+
110+
<AuthModal
111+
isOpen={openAuthModal}
112+
onClose={() => setOpenAuthModal(false)}
113+
stopRedirection={false}
114+
/>
99115
</Suspense>
100116
</main>
101117
</div>
Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
'use client';
1+
"use client";
22

3-
import React, { useState } from 'react';
4-
import { ListChecks } from 'lucide-react';
5-
import { AuthModal } from './sections/auth-modal';
3+
import React, { useState } from "react";
4+
import { ListChecks } from "lucide-react";
5+
import { AuthModal } from "./sections/auth-modal";
66

77
interface Step {
88
number: number;
@@ -16,42 +16,40 @@ interface HowItWorksProps {
1616
}
1717

1818
const HowItWorks: React.FC<HowItWorksProps> = ({ steps }) => {
19-
20-
const [openAuthModal, setOpenAuthModal] = useState(false);
21-
19+
const [openAuthModal, setOpenAuthModal] = useState(false);
2220

2321
return (
24-
<div className="dark:bg-black bg-white text-[var(--white-text-color)] py-8">
25-
<div className="mx-auto">
26-
<div className="flex items-center mb-6 gap-2">
27-
<ListChecks color="var(--white-text-color)" />
28-
<h2 className="text-lg font-medium ml-1">How It Works</h2>
22+
<div className='dark:bg-black bg-white text-[var(--white-text-color)] py-8'>
23+
<div className='mx-auto'>
24+
<div className='flex items-center mb-6 gap-2'>
25+
<ListChecks color='var(--white-text-color)' />
26+
<h2 className='text-lg font-medium ml-1'>How It Works</h2>
2927
</div>
3028

31-
<div className="relative">
29+
<div className='relative'>
3230
<svg
33-
className="absolute top-0 h-full z-5 pl-8"
34-
width="70"
35-
preserveAspectRatio="none"
31+
className='absolute top-0 h-full z-5 pl-8'
32+
width='70'
33+
preserveAspectRatio='none'
3634
style={{ height: "calc(100% - 20px)" }}
3735
>
3836
<path
39-
d="M4,0 C24,50 50,100 30,124 C1,200 30,250 40,300 C50,350 30,400 40,450"
40-
fill="none"
41-
stroke="var(--white-text-color)"
42-
strokeWidth="2"
43-
strokeDasharray="8,8"
44-
strokeLinecap="round"
37+
d='M4,0 C24,50 50,100 30,124 C1,200 30,250 40,300 C50,350 30,400 40,450'
38+
fill='none'
39+
stroke='var(--white-text-color)'
40+
strokeWidth='2'
41+
strokeDasharray='8,8'
42+
strokeLinecap='round'
4543
/>
4644
</svg>
4745

48-
<div className="space-y-5 relative mb-8">
46+
<div className='space-y-5 relative mb-8'>
4947
{steps.map((step, index) => (
5048
<div
5149
key={step.number}
52-
className="flex items-center gap-4 relative bg-card-grad rounded-md shadow-md pl-10"
50+
className='flex items-center gap-4 relative bg-card-grad rounded-md shadow-md pl-10'
5351
>
54-
<div className="w-9 h-9 bg-white rounded-full flex items-center justify-center text-black text-xl font-semibold z-10">
52+
<div className='w-9 h-9 bg-white rounded-full flex items-center justify-center text-black text-xl font-semibold z-10'>
5553
{step.number}
5654
</div>
5755

@@ -61,10 +59,10 @@ const [openAuthModal, setOpenAuthModal] = useState(false);
6159
} rounded-lg py-6 px-2 min-h-[80px] flex items-center text-wrap`}
6260
onClick={() => step.number === 1 && setOpenAuthModal(true)}
6361
>
64-
<h3 className="text-base font-medium dark:text-white text-black">
62+
<h3 className='text-base font-medium dark:text-white text-black'>
6563
{step.title}
6664
{step.linkText && (
67-
<span className="ml-2 underline">{step.linkText}</span>
65+
<span className='ml-2 underline'>{step.linkText}</span>
6866
)}
6967
</h3>
7068
</div>
@@ -83,4 +81,4 @@ const [openAuthModal, setOpenAuthModal] = useState(false);
8381
);
8482
};
8583

86-
export default HowItWorks;
84+
export default HowItWorks;

components/ambassador-dao/auth-button.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ import {
99
} from "@/services/ambassador-dao/requests/auth";
1010
import Image from "next/image";
1111
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";
12-
import { ListIcon, LogOut, User2Icon } from "lucide-react";
12+
import {
13+
ListIcon,
14+
LogOut,
15+
User2Icon,
16+
UserCheck2,
17+
UserIcon,
18+
} from "lucide-react";
1319
import { useRouter } from "next/navigation";
1420

1521
export const AuthButton = () => {
@@ -37,6 +43,21 @@ export const AuthButton = () => {
3743
</PopoverTrigger>
3844
<PopoverContent className='w-auto p-0' align='start'>
3945
<div className='w-42 bg-[#fafafa] dark:bg-[#09090B] rounded-md flex flex-col space-y-1'>
46+
{(!user.role || !user.first_name) && (
47+
<>
48+
<div
49+
onClick={() => router.push("/ambassador-dao/onboard")}
50+
className='px-3 py-2 flex items-center gap-2 cursor-pointer hover:bg-opacity-50 dark:bg-[#000]'
51+
>
52+
<UserCheck2
53+
color='var(--white-text-color)'
54+
size={16}
55+
/>
56+
Onboard
57+
</div>
58+
<hr />
59+
</>
60+
)}
4061
{user.role === "SPONSOR" ? (
4162
<>
4263
<div

components/ambassador-dao/dashboard/BountiesSection.tsx

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,15 @@ const BountiesSection = ({
5454
onResetFilters;
5555
};
5656

57-
console.log(filters)
5857
return (
59-
<section className="border border-[var(--default-border-color)] rounded-md py-10 px-6 mb-12">
60-
<div className="flex justify-between">
61-
<h2 className="text-3xl font-medium mb-6 flex items-center gap-2">
62-
<Lightbulb size={36} color="var(--white-text-color)" /> Bounties
58+
<section className='border border-[var(--default-border-color)] rounded-md py-10 px-6 mb-12'>
59+
<div className='flex justify-between'>
60+
<h2 className='text-3xl font-medium mb-6 flex items-center gap-2'>
61+
<Lightbulb size={36} color='var(--white-text-color)' /> Bounties
6362
</h2>
64-
{data?.length > 0 && <ViewAllButton type="bounties" />}
63+
{data?.length > 0 && <ViewAllButton type='bounties' />}
6564
</div>
66-
<div className="grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6 w-full">
65+
<div className='grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6 w-full'>
6766
<FilterDropdown
6867
label={filters.sort_direction}
6968
options={sortOrderTypes}
@@ -72,38 +71,37 @@ const BountiesSection = ({
7271
/>
7372

7473
<FilterDropdown
75-
label="Skill Set"
74+
label='Skill Set'
7675
options={skills}
7776
value={filters.skill_ids}
7877
onValueChange={(value) => updateFilters({ skill_ids: value })}
7978
/>
8079

81-
<span
82-
className="flex cursor-pointer rounded-lg px-4 py-2 text-[var(--default-text-color)] items-center border dark:border-[var(--default-text-color)] text-sm"
83-
onClick={clearAllFilters}
84-
>
85-
Reset Filters
86-
</span>
87-
80+
<span
81+
className='flex cursor-pointer rounded-lg px-4 py-2 text-[var(--default-text-color)] items-center border dark:border-[var(--default-text-color)] text-sm'
82+
onClick={clearAllFilters}
83+
>
84+
Reset Filters
85+
</span>
8886

8987
{/* Search input */}
90-
<div className="relative">
88+
<div className='relative'>
9189
<input
92-
type="text"
93-
placeholder="Search"
90+
type='text'
91+
placeholder='Search'
9492
value={searchInput}
9593
onChange={handleSearchChange}
96-
className="text-sm h-10 text-[var(--white-text-color)] border border-[var(--default-border-color)] rounded-md px-4 py-2 focus:outline-none w-full"
94+
className='text-sm h-10 text-[var(--white-text-color)] border border-[var(--default-border-color)] rounded-md px-4 py-2 focus:outline-none w-full'
9795
/>
98-
<button className="absolute right-3 top-1/2 transform -translate-y-1/2">
99-
<Search color="#9F9FA9" className="h-3 w-3 sm:w-5 sm:h-5" />
96+
<button className='absolute right-3 top-1/2 transform -translate-y-1/2'>
97+
<Search color='#9F9FA9' className='h-3 w-3 sm:w-5 sm:h-5' />
10098
</button>
10199
</div>
102100
</div>
103101

104-
<div className="space-y-4">
102+
<div className='space-y-4'>
105103
{isLoading && (
106-
<div className="flex items-center justify-center h-[400px] py-14 mb-12">
104+
<div className='flex items-center justify-center h-[400px] py-14 mb-12'>
107105
<Loader />
108106
</div>
109107
)}
@@ -114,9 +112,9 @@ const BountiesSection = ({
114112

115113
{!isLoading && data?.length === 0 && (
116114
<EmptyState
117-
title="No Bounty Matches Your Filters"
118-
description="Try adjusting criteria"
119-
className="mt-8"
115+
title='No Bounty Matches Your Filters'
116+
description='Try adjusting criteria'
117+
className='mt-8'
120118
/>
121119
)}
122120
</div>

0 commit comments

Comments
 (0)