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

Function PlusInfo

packages/shared/src/components/plus/PlusInfo.tsx:128–327  ·  view source on GitHub ↗
({
  productOptions,
  selectedOption,
  onChange,
  onContinue,
  shouldShowPlusHeader = true,
  showPlusList = true,
  showDailyDevLogo = false,
  showGiftButton = true,
  showTrustReviews = true,
  title,
  description,
  subtitle,
  continueEnabled = true,
  isContinueLoading = false,
}: PlusInfoProps & CommonPlusPageProps)

Source from the content-addressed store, hash-verified

126};
127
128export const PlusInfo = ({
129 productOptions,
130 selectedOption,
131 onChange,
132 onContinue,
133 shouldShowPlusHeader = true,
134 showPlusList = true,
135 showDailyDevLogo = false,
136 showGiftButton = true,
137 showTrustReviews = true,
138 title,
139 description,
140 subtitle,
141 continueEnabled = true,
142 isContinueLoading = false,
143}: PlusInfoProps & CommonPlusPageProps): ReactElement => {
144 const router = useRouter();
145 const { giftOneYear, isOrganization, checkoutItemsLoading } =
146 usePaymentContext();
147 const { openModal } = useLazyModal();
148 const { logSubscriptionEvent } = usePlusSubscription();
149 const { giftToUser } = useGiftUserContext();
150
151 const [itemQuantity, setItemQuantity] = useState<number>(1);
152
153 const plusType = getPlusType({
154 isGift: !!giftToUser,
155 isOrganization,
156 });
157 const defaultCopy = plusInfoCopyApi[plusType];
158 const titleCopy = title || defaultCopy.title;
159 const descriptionCopy = description || defaultCopy.description;
160 const subtitleCopy = subtitle || defaultCopy.subtitle;
161
162 const isOnboarding = router.pathname.startsWith('/onboarding');
163 const showBuyAsAGiftButton =
164 !giftToUser && showGiftButton && !!giftOneYear && !isOnboarding;
165 const coresGiveback = plusType === PlusType.Self && (
166 <PlusCoresGiveback
167 option={productOptions?.find(
168 (option) => option.priceId === selectedOption,
169 )}
170 className="mt-3"
171 />
172 );
173 const plusListContent = isOrganization ? (
174 <PlusList items={plusOrganizationFeatureList} />
175 ) : (
176 <PlusList />
177 );
178
179 return (
180 <>
181 {shouldShowPlusHeader && (
182 <div className="mb-6 flex items-center">
183 {showDailyDevLogo && <Logo logoClassName={{ container: 'h-5' }} />}
184 </div>
185 )}

Callers

nothing calls this directly

Calls 10

usePaymentContextFunction · 0.90
useLazyModalFunction · 0.90
usePlusSubscriptionFunction · 0.90
useGiftUserContextFunction · 0.90
isIOSNativeFunction · 0.90
getPlusTypeFunction · 0.85
openModalFunction · 0.85
pushMethod · 0.80
useRouterFunction · 0.50
onChangeFunction · 0.50

Tested by

no test coverage detected