diff --git a/components/ArchivedAuctions.tsx/ArchivedAuctions.tsx b/components/ArchivedAuctions.tsx/ArchivedAuctions.tsx index eba44317..dd480d9a 100644 --- a/components/ArchivedAuctions.tsx/ArchivedAuctions.tsx +++ b/components/ArchivedAuctions.tsx/ArchivedAuctions.tsx @@ -219,10 +219,10 @@ const ArchivedAuctionsList = (props: Props) => {
- handleDateChange(date, 'from')} className={'form-control'} /> + handleDateChange(date ?? new Date(), 'from')} className={'form-control'} />
- handleDateChange(date, 'to')} className={'form-control'} /> + handleDateChange(date ?? new Date(), 'to')} className={'form-control'} />
setSelectedFilter(filter)} />
diff --git a/components/FlipTracking/FlipTracking.tsx b/components/FlipTracking/FlipTracking.tsx index 1bbe60a1..95f0f369 100644 --- a/components/FlipTracking/FlipTracking.tsx +++ b/components/FlipTracking/FlipTracking.tsx @@ -335,8 +335,8 @@ export function FlipTracking(props: Props) {
{ - setRangeStartDate(e) - loadFlipsForTimespan(e, rangeEndDate) + setRangeStartDate(e ?? new Date()) + loadFlipsForTimespan(e ?? new Date(), rangeEndDate) }} className={'form-control'} minDate={new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30 * 2)} @@ -348,8 +348,8 @@ export function FlipTracking(props: Props) { { - setRangeEndDate(e) - loadFlipsForTimespan(rangeStartDate, e) + setRangeEndDate(e?? new Date()) + loadFlipsForTimespan(rangeStartDate, e?? new Date()) }} minDate={new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30 * 2)} maxDate={new Date()} diff --git a/components/Premium/BuyPremium/BuyPremium.tsx b/components/Premium/BuyPremium/BuyPremium.tsx index 1155f37a..577e6a5e 100644 --- a/components/Premium/BuyPremium/BuyPremium.tsx +++ b/components/Premium/BuyPremium/BuyPremium.tsx @@ -56,42 +56,14 @@ function BuyPremium(props: Props) { }) } - function onSubscriptionBuy(googleToken: string) { - let productId = '' - if (purchasePremiumType.productId === 'premium') { - productId = 'l_premium' - } - if (purchasePremiumType.productId === 'premium_plus') { - productId = 'l_prem_plus' - } - - api.purchasePremiumSubscription(productId, googleToken).then(data => { - window.open(data.directLink, '_self') - }) - } - function onPremiumBuyCancel() { setShowPrepaidConfirmationDialog(false) } - function onSubscriptionBuyCancel() { - setShowSubscriptionConfirmationDialog(false) - } - function getPurchasePrice() { return purchasePremiumOption.value * purchasePremiumOption.price } - function getSubscriptionPrice() { - if (purchasePremiumType.productId === 'premium') { - return 8.69 - } - if (purchasePremiumType.productId === 'premium_plus') { - return 29.69 - } - return -1 - } - function getDurationString(): string { let durationString = purchasePremiumType.durationString let duration = +purchasePremiumOption.value @@ -181,20 +153,6 @@ function BuyPremium(props: Props) {
) : null}

This is a prepaid service. We won't automatically charge you after your premium time runs out!

- {(purchasePremiumType.productId === 'premium' || purchasePremiumType.productId === 'premium_plus') && - (!props.premiumSubscriptions || props.premiumSubscriptions.length === 0) ? ( -

- If you want to it to automatically renew itself,{' '} - { - setShowSubscriptionConfirmationDialog(true) - }} - style={{ color: '#007bff', cursor: 'pointer' }} - > - click here - -

- ) : null}
+
+ + + + + + + Premium + + +
    +
  • up to 1s slower than prem+
  • +
  • a lot of tools
  • +
  • extended history & filter access
  • +
+

Use NICEDISCOUNT for 31% discount for 1 month
+ Use BLACKFRIDAY for 10% discount for 12 months
+

+
+ +
+
+
+ + + {selectedPremiumType && ( + type.productId === 'premium')?.options[0]!} + purchasePrice={<>{getSubscriptionPrice()} per month} + purchasePremiumType={selectedPremiumType!} + onHide={onSubscriptionBuyCancel} + onConfirm={onSubscriptionBuy} + activePremiumProduct={props.activePremiumProduct} + /> + )} + + ) +} + +export default BuySubscription diff --git a/components/Premium/Premium.tsx b/components/Premium/Premium.tsx index 95532510..b2940ab4 100644 --- a/components/Premium/Premium.tsx +++ b/components/Premium/Premium.tsx @@ -14,6 +14,7 @@ import { CANCELLATION_RIGHT_CONFIRMED } from '../../utils/SettingsUtils' import { getHighestPriorityPremiumProduct } from '../../utils/PremiumTypeUtils' import PremiumStatus from './PremiumStatus/PremiumStatus' import { toast } from 'react-toastify' +import BuySubscription from './BuySubscription/BuySubscription' function Premium() { let [isLoggedIn, setIsLoggedIn] = useState(false) @@ -110,6 +111,15 @@ function Premium() { {isLoggedIn ? (
+
+

Subscriptions

+ +
+ ) : null} + {isLoggedIn ? ( +
+
+

Prepaid