@@ -10,10 +10,10 @@ import HowItWorks from "../How-it-works";
1010
1111const UserProfileCard = ( { userData } : any ) => {
1212 return (
13- < div className = " shadow-sm border border-[var(--default-border-color)] rounded-lg p-4 mb-6" >
14- < div className = " flex flex-wrap items-center" >
15- < div className = " w-10 h-10 rounded-full bg-gray-600 mr-3 flex items-center justify-center" >
16- < span className = " text-white" >
13+ < div className = ' shadow-sm border border-[var(--default-border-color)] rounded-lg p-4 mb-6' >
14+ < div className = ' flex flex-wrap items-center' >
15+ < div className = ' w-10 h-10 rounded-full bg-gray-600 mr-3 flex items-center justify-center' >
16+ < span className = ' text-white' >
1717 { userData ?. first_name && userData ?. last_name
1818 ? `${ userData . first_name . charAt ( 0 ) } ${ userData . last_name . charAt (
1919 0
@@ -23,17 +23,17 @@ const UserProfileCard = ({ userData }: any) => {
2323 : "" }
2424 </ span >
2525 </ div >
26- < div className = " text-sm" >
27- < h3 className = " font-medium text-wrap" >
26+ < div className = ' text-sm' >
27+ < h3 className = ' font-medium text-wrap' >
2828 { userData ?. first_name } { userData ?. last_name } { " " }
2929 { ! userData ?. first_name && userData ?. email }
3030 </ h3 >
31- < p className = " text-xs text-[var(--secondary-text-color)]" >
31+ < p className = ' text-xs text-[var(--secondary-text-color)]' >
3232 { userData ?. username ? `@${ userData ?. username } ` : "" }
3333 </ p >
3434 </ div >
35- < div className = " ml-auto" >
36- < span className = " px-3 py-1 rounded-full text-sm" >
35+ < div className = ' ml-auto' >
36+ < span className = ' px-3 py-1 rounded-full text-sm' >
3737 { userData ?. job_title }
3838 </ span >
3939 </ div >
@@ -45,15 +45,15 @@ const UserProfileCard = ({ userData }: any) => {
4545export const AmbassadorCard = ( {
4646 title,
4747 description,
48- link ,
48+ onClick ,
4949} : {
5050 title : string ;
5151 description : string ;
52- link : string ;
52+ onClick : ( ) => void ;
5353} ) => {
54- const openInNewTab = ( url : string ) => {
55- window . open ( url , "_blank" , "noopener,noreferrer" ) ;
56- } ;
54+ // const openInNewTab = (url: string) => {
55+ // window.open(url, "_blank", "noopener,noreferrer");
56+ // };
5757
5858 return (
5959 < >
@@ -62,18 +62,18 @@ export const AmbassadorCard = ({
6262 className = { `max-w-[592px] ${
6363 title === "Become a Member" ? "red-card-bg" : "blue-card-bg"
6464 } rounded-lg p-4 mb-4 relative overflow-hidden cursor-pointer border border-[var(--default-border-color)]`}
65- onClick = { ( ) => openInNewTab ( link ) }
65+ onClick = { onClick }
6666 >
67- < div className = " relative z-10 text-[var(--white-text-color)]" >
68- < h3 className = " font-medium mb-1 text-lg md:text-xl text-[var(--white-text-color)]" >
67+ < div className = ' relative z-10 text-[var(--white-text-color)]' >
68+ < h3 className = ' font-medium mb-1 text-lg md:text-xl text-[var(--white-text-color)]' >
6969 { title }
7070 </ h3 >
71- < p className = " text-sm opacity-80 text-[var(--secondary-text-color)]" >
71+ < p className = ' text-sm opacity-80 text-[var(--secondary-text-color)]' >
7272 { description }
7373 </ p >
7474 </ div >
75- < div className = " absolute right-3 top-1/2 transform -translate-y-1/2" >
76- < ArrowUpRight color = " white" className = " h-6 w-6" />
75+ < div className = ' absolute right-3 top-1/2 transform -translate-y-1/2' >
76+ < ArrowUpRight color = ' white' className = ' h-6 w-6' />
7777 </ div >
7878 </ div >
7979 </ >
@@ -84,14 +84,14 @@ const LeaderboardCard = () => {
8484 return (
8585 < Link href = { "/ambassador-dao/leaderboard" } >
8686 { " " }
87- < div className = " rounded-md trophy mb-4 relative overflow-hidden cursor-pointer dark:border-none border border-[var(--default-border-color)] h-[72px]" >
88- < div className = " relative z-10 text-[var(--white-text-color)] p-4" >
89- < h3 className = " font-medium text-lg md:text-xl mb-1 text-[var(--white-text-color)]" >
87+ < div className = ' rounded-md trophy mb-4 relative overflow-hidden cursor-pointer dark:border-none border border-[var(--default-border-color)] h-[72px]' >
88+ < div className = ' relative z-10 text-[var(--white-text-color)] p-4' >
89+ < h3 className = ' font-medium text-lg md:text-xl mb-1 text-[var(--white-text-color)]' >
9090 Leaderboard
9191 </ h3 >
9292 </ div >
93- < div className = " absolute right-3 top-1/2 transform -translate-y-1/2" >
94- < ArrowUpRight color = " var(--white-text-color)" className = " h-6 w-6" />
93+ < div className = ' absolute right-3 top-1/2 transform -translate-y-1/2' >
94+ < ArrowUpRight color = ' var(--white-text-color)' className = ' h-6 w-6' />
9595 </ div >
9696 </ div >
9797 </ Link >
@@ -122,33 +122,34 @@ const SideContent = ({ user }: { user: any }) => {
122122
123123 if ( position === 1 ) {
124124 return (
125- < Image src = { GoldReward } alt = " First Place" width = { 46 } height = { 46 } />
125+ < Image src = { GoldReward } alt = ' First Place' width = { 46 } height = { 46 } />
126126 ) ;
127127 } else if ( position === 2 ) {
128128 return (
129- < Image src = { SilverReward } alt = " Second Place" width = { 46 } height = { 46 } />
129+ < Image src = { SilverReward } alt = ' Second Place' width = { 46 } height = { 46 } />
130130 ) ;
131131 } else if ( position === 3 ) {
132132 return (
133- < Image src = { BronzeReward } alt = " Third Place" width = { 46 } height = { 46 } />
133+ < Image src = { BronzeReward } alt = ' Third Place' width = { 46 } height = { 46 } />
134134 ) ;
135135 } else {
136136 return (
137137 < div
138- className = " px-6 py-1 flex items-center justify-center rounded-full bg-[#2F2F33] w-fit"
138+ className = ' px-6 py-1 flex items-center justify-center rounded-full bg-[#2F2F33] w-fit'
139139 style = { {
140140 background : "linear-gradient(90deg, #E84142 0%, #822425 100%)" ,
141141 } }
142142 >
143- < span className = " text-[var(--white-text-color)]" > { position } </ span >
143+ < span className = ' text-[var(--white-text-color)]' > { position } </ span >
144144 </ div >
145145 ) ;
146146 }
147147 } ;
148148
149149 return (
150- < div className = "lg:col-span-1" >
151- < HowItWorks steps = { steps } />
150+ < div className = 'lg:col-span-1' >
151+ { ! user ? < HowItWorks steps = { steps } /> : null }
152+
152153 < LeaderboardCard />
153154 < >
154155 { leaderboardData ?. data ?. slice ( 0 , 3 ) ?. map ( ( user , index ) => (
@@ -166,27 +167,27 @@ const SideContent = ({ user }: { user: any }) => {
166167 : "" ,
167168 } }
168169 >
169- < div className = " col-span-1" > { getRankIcon ( index , currentPage ) } </ div >
170+ < div className = ' col-span-1' > { getRankIcon ( index , currentPage ) } </ div >
170171
171- < div className = " col-span-9 flex items-center gap-4" >
172+ < div className = ' col-span-9 flex items-center gap-4' >
172173 < Image
173174 src = { DefaultAvatar }
174175 alt = { user . nickname }
175176 width = { 32 }
176177 height = { 32 }
177- className = " hidden md:block rounded-full"
178+ className = ' hidden md:block rounded-full'
178179 />
179180 < span
180- className = " text-[var(--white-text-color)] text-xs sm:!text-base capitalize truncate max-w-[150px]"
181+ className = ' text-[var(--white-text-color)] text-xs sm:!text-base capitalize truncate max-w-[150px]'
181182 title = { user . nickname }
182183 >
183184 { user . nickname }
184185 </ span >
185186 </ div >
186187
187- < div className = " col-span-2 flex justify-end" >
188+ < div className = ' col-span-2 flex justify-end' >
188189 { user . tag === "ambassador" && (
189- < span className = " px-3 py-1 text-xs flex justify-center items-center dark:bg-[#444444] bg-[#e4e4e7] text-[var(--white-text-color)] rounded-md capitalize" >
190+ < span className = ' px-3 py-1 text-xs flex justify-center items-center dark:bg-[#444444] bg-[#e4e4e7] text-[var(--white-text-color)] rounded-md capitalize' >
190191 { user . tag }
191192 </ span >
192193 ) }
0 commit comments