@@ -153,7 +153,6 @@ export default function DefaultTemplate({
153153 sponsorUrl = { sponsorUrl }
154154 sponsorImage = { sponsorImage }
155155 bountyData = { bountyData }
156- dropdownLinks = { dropdownLinks }
157156 bountyTimelineObject = { bountyTimelineObject }
158157 updateBountyTileStatus = { updateBountyTileStatus }
159158 /> }
@@ -240,7 +239,7 @@ function IsContest({
240239 updateContestTileStatus : ( ) => void ;
241240 contestTimelineObject : ContestSchedule | undefined ;
242241} ) {
243- const { contestUrl, amount, findingsRepo } = contestData ;
242+ const { contestUrl, amount, findingsRepo, startDate , endDate } = contestData ;
244243
245244 return (
246245 < Fragment >
@@ -253,13 +252,14 @@ function IsContest({
253252 target = "_blank"
254253 rel = "noreferrer noopener"
255254 className = "logo"
255+ onClick = { ( e ) => e . stopPropagation ( ) }
256256 >
257- < img
258- alt = "Sponsor logo"
259- src = { sponsorImage ?? "/" }
260- width = { 88 }
261- height = { 88 }
262- />
257+ < img
258+ alt = "Sponsor logo"
259+ src = { sponsorImage ?? "/" }
260+ width = { 88 }
261+ height = { 88 }
262+ />
263263 </ a >
264264 ) : (
265265 < img
@@ -281,7 +281,12 @@ function IsContest({
281281 </ small >
282282 { /* Contest title */ }
283283 < h2 className = "title" >
284- < a href = { contestUrl ? `${ contestData . contestUrl } #top` : '#' } > { title } </ a >
284+ < a
285+ href = { contestUrl }
286+ onClick = { ( e ) => e . stopPropagation ( ) }
287+ >
288+ { title }
289+ </ a >
285290 </ h2 >
286291 { /* Contest description */ }
287292 < p className = "description" >
@@ -313,30 +318,31 @@ function IsContest({
313318 < div className = "details" >
314319 { contestTimelineObject && < ContestStatus
315320 className = { `status ${ clsx (
316- contestTimelineObject . contestStatus === Status . ENDED && "ended"
321+ contestTimelineObject . contestStatus === Status . ENDED && "ended"
317322 ) } `}
318323 status = { contestTimelineObject . contestStatus }
319324 /> }
320- { contestTimelineObject && contestTimelineObject . contestStatus !== Status . ENDED && (
325+ { contestData && contestTimelineObject && contestTimelineObject . contestStatus !== Status . ENDED && (
321326 < div className = "timer" >
322- < Countdown
323- start = { contestData . startDate }
324- end = { contestData . endDate }
325- updateContestStatus = { updateContestTileStatus }
326- text = {
327- contestTimelineObject . contestStatus === Status . UPCOMING
328- ? "Starts in "
329- : "Ends in "
330- }
331- />
327+ < Countdown
328+ start = { startDate }
329+ end = { endDate }
330+ updateContestStatus = { updateContestTileStatus }
331+ text = {
332+ contestTimelineObject . contestStatus === Status . UPCOMING
333+ ? "Starts in "
334+ : "Ends in "
335+ }
336+ />
332337 </ div >
333338 ) }
334339 </ div >
335340 < div className = "options" >
336341 < a
337342 className = "contest-redirect"
338343 aria-label = "View audit"
339- href = { `${ contestData . contestUrl } ` }
344+ href = { contestUrl }
345+ onClick = { ( e ) => e . stopPropagation ( ) }
340346 >
341347 { ! findingsRepo || findingsRepo === "" ? "Preview" : "View" } audit
342348 </ a >
@@ -353,7 +359,6 @@ function IsBounty({
353359 sponsorUrl,
354360 sponsorImage,
355361 bountyData,
356- dropdownLinks,
357362 updateBountyTileStatus,
358363 bountyTimelineObject
359364} : {
@@ -362,12 +367,6 @@ function IsBounty({
362367 sponsorUrl ?: string ;
363368 sponsorImage ?: string ;
364369 bountyData : BountyTileData ;
365- dropdownLinks : {
366- label : string ;
367- href : string ;
368- external ?: boolean ;
369- ariaLabel ?: string ;
370- } [ ]
371370 updateBountyTileStatus ?: ( ) => void ;
372371 bountyTimelineObject ?: ContestSchedule | undefined ;
373372} ) {
@@ -385,6 +384,7 @@ function IsBounty({
385384 target = "_blank"
386385 rel = "noreferrer noopener"
387386 className = "logo"
387+ onClick = { ( e ) => e . stopPropagation ( ) }
388388 >
389389 < img
390390 alt = "Sponsor logo"
@@ -405,7 +405,12 @@ function IsBounty({
405405 < div className = "content--wrapper" >
406406 { /* Contest title */ }
407407 < h2 className = "title" >
408- < a href = { bountyUrl ? `${ bountyUrl } #top` : '#' } > { title } </ a >
408+ < a
409+ href = { bountyUrl }
410+ onClick = { ( e ) => e . stopPropagation ( ) }
411+ >
412+ { title }
413+ </ a >
409414 </ h2 >
410415 { /* Contest description */ }
411416 < p className = "description" >
@@ -428,7 +433,7 @@ function IsBounty({
428433 ) } `}
429434 status = { bountyTimelineObject . contestStatus }
430435 /> }
431- { bountyTimelineObject && bountyTimelineObject . contestStatus === Status . UPCOMING && (
436+ { bountyData && bountyTimelineObject && bountyTimelineObject . contestStatus === Status . UPCOMING && (
432437 < div className = "timer" >
433438 < Countdown
434439 start = { startDate }
@@ -443,7 +448,8 @@ function IsBounty({
443448 < a
444449 className = "contest-redirect"
445450 aria-label = "View bounty"
446- href = { `${ bountyUrl } ` }
451+ href = { bountyUrl }
452+ onClick = { ( e ) => e . stopPropagation ( ) }
447453 >
448454 View details
449455 </ a >
0 commit comments