Skip to content

Commit

Permalink
Enable startup program (#2230)
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoiacovino authored Feb 20, 2024
1 parent 5fe6723 commit 4bbb7d4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
3 changes: 2 additions & 1 deletion components/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { GLOBAL_EWS_AUTH_TOKEN_KEY } from "constants/app";
import { walletIds } from "@thirdweb-dev/wallets";
import { OnboardingChoosePlan } from "./ChoosePlan";
import { OnboardingLinkWallet } from "./LinkWallet";
import { useLocalStorage } from "hooks/useLocalStorage";

const skipBilling = (account: Account) => {
return (
Expand All @@ -43,7 +44,7 @@ export const Onboarding: React.FC = () => {
const trackEvent = useTrack();
const wallet = useWallet();
const ewsConfirmMutation = useConfirmEmbeddedWallet();
const claimGrowth = false;
const [claimGrowth] = useLocalStorage("startup-program", false, true);

const [state, setState] = useState<OnboardingState>();
const [account, setAccount] = useState<Account>();
Expand Down
3 changes: 2 additions & 1 deletion components/settings/Account/Billing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ import { BillingPricing } from "./Pricing";
import { OnboardingBilling } from "components/onboarding/Billing";
import { OnboardingModal } from "components/onboarding/Modal";
import { FiExternalLink } from "react-icons/fi";
import { useLocalStorage } from "hooks/useLocalStorage";

interface BillingProps {
account: Account;
}

export const Billing: React.FC<BillingProps> = ({ account }) => {
const claimGrowth = false;
const [claimGrowth] = useLocalStorage("startup-program", false, true);
const updatePlanMutation = useUpdateAccountPlan();
const {
isOpen: isPaymentMethodOpen,
Expand Down
3 changes: 2 additions & 1 deletion pages/dashboard/settings/billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { useRouter } from "next/router";
import { useLoggedInUser } from "@3rdweb-sdk/react/hooks/useLoggedInUser";
import { Billing } from "components/settings/Account/Billing";
import { BillingConnectWalletPrompt } from "components/settings/Account/Billing/ConnectWallet";
import { useLocalStorage } from "hooks/useLocalStorage";

const SettingsBillingPage: ThirdwebNextPage = () => {
const { isLoggedIn, isLoading } = useLoggedInUser();
const meQuery = useAccount();
const router = useRouter();
const { data: account } = meQuery;
const claimGrowth = false;
const [claimGrowth] = useLocalStorage("startup-program", false, true);

useEffect(() => {
let refetchInterval: ReturnType<typeof setInterval> | undefined;
Expand Down
20 changes: 19 additions & 1 deletion pages/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,30 @@ import { PricingSection } from "components/homepage/sections/PricingSection";
import { FAQ_GENERAL, FAQ_PRICING, PRICING_SECTIONS } from "utils/pricing";
import { IoIosInformationCircleOutline } from "react-icons/io";
import { FiExternalLink } from "react-icons/fi";
import { useEffect } from "react";
import { useRouter } from "next/router";
import { useLocalStorage } from "hooks/useLocalStorage";

const TRACKING_CATEGORY = "pricing-page";

const Pricing: ThirdwebNextPage = () => {
const router = useRouter();
const [claimGrowth, setClaimedGrowth] = useLocalStorage(
"startup-program",
false,
true,
);
const { startupProgram: claimGrowthQuery } = router.query;

const isMobile = useBreakpointValue({ base: true, lg: false }) as boolean;

useEffect(() => {
if (claimGrowthQuery !== undefined) {
setClaimedGrowth(true);
router.replace("/pricing");
}
}, [claimGrowthQuery, router, setClaimedGrowth]);

return (
<LandingLayout
seo={{
Expand All @@ -52,7 +70,7 @@ const Pricing: ThirdwebNextPage = () => {
>
<PricingSection
trackingCategory={TRACKING_CATEGORY}
canTrialGrowth={false}
canTrialGrowth={claimGrowth}
/>

<Flex flexDir="column" gap={20}>
Expand Down

0 comments on commit 4bbb7d4

Please sign in to comment.