MCPcopy Create free account
hub / github.com/dailydotdev/apps / QuestDropdownPanel

Function QuestDropdownPanel

packages/shared/src/components/quest/QuestButton.tsx:467–601  ·  view source on GitHub ↗
({
  showLevelSystem,
  renderedLevel,
  data,
  isPending,
  isError,
  claimingQuestId,
  animatingClaimRotationIds,
  claimedStampRotationIds,
  animatingClaimedStampRotationIds,
  deferredClaimedStampRotationIds,
  onClaim,
  onDestinationClick,
}: QuestDropdownPanelProps)

Source from the content-addressed store, hash-verified

465}
466
467const QuestDropdownPanel = ({
468 showLevelSystem,
469 renderedLevel,
470 data,
471 isPending,
472 isError,
473 claimingQuestId,
474 animatingClaimRotationIds,
475 claimedStampRotationIds,
476 animatingClaimedStampRotationIds,
477 deferredClaimedStampRotationIds,
478 onClaim,
479 onDestinationClick,
480}: QuestDropdownPanelProps): ReactElement => {
481 const { logEvent } = useLogContext();
482 const openQuestRefresh = useOpenQuestRefresh({
483 targetId: TargetId.QuestDropdown,
484 });
485
486 useEffect(() => {
487 logEvent({
488 event_name: LogEvent.Impression,
489 target_type: TargetType.Quest,
490 });
491 }, [logEvent]);
492
493 return (
494 <div className="flex flex-col">
495 <header className="flex flex-col gap-2 border-b border-border-subtlest-tertiary p-3">
496 <p className="font-bold text-text-primary typo-callout">Quests</p>
497 {showLevelSystem && (
498 <div className="flex items-center justify-between gap-2 text-text-tertiary typo-caption1">
499 <span>Level {renderedLevel}</span>
500 {data?.level && (
501 <span>
502 {data.level.xpInLevel}/
503 {data.level.xpInLevel + data.level.xpToNextLevel} XP
504 </span>
505 )}
506 </div>
507 )}
508 </header>
509
510 <div className="flex flex-col gap-4 p-3">
511 {isPending && (
512 <p className="text-text-tertiary typo-caption1">Loading quests...</p>
513 )}
514
515 {isError && !data && (
516 <p className="text-text-tertiary typo-caption1">
517 Quests are unavailable right now.
518 </p>
519 )}
520
521 {!isPending && data && (
522 <>
523 <QuestSection
524 title="Daily"

Callers

nothing calls this directly

Calls 3

useLogContextFunction · 0.90
useOpenQuestRefreshFunction · 0.90
logEventFunction · 0.85

Tested by

no test coverage detected