Skip to content

Commit c900f03

Browse files
committed
Convert account store to TypeScript
1 parent 5425149 commit c900f03

File tree

5 files changed

+201
-189
lines changed

5 files changed

+201
-189
lines changed

src/components/sections/pricing/plans/components/switch/switch.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Interval } from "@httptoolkit/accounts";
1+
import { Interval } from "@/lib/store/account-store";
22

33
interface Option {
44
text: string;

src/components/sections/pricing/plans/hooks/get-plan-cta.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { StyledPricingCardCTAWrapper } from '../components/card/card.styles';
99
import { Button } from '@/components/elements/button';
1010
import { PaperPlaneTilt, Sparkle, Spinner } from '@/components/elements/icon';
1111
import { Text } from '@/components/elements/text';
12-
import type { AccountStore } from '@/lib/store/account-store';
12+
import type { AccountStore, Interval } from '@/lib/store/account-store';
1313

1414
/**
1515
* @param {React.ReactNode} downloadButton - DrowpdownButton is a server component, so we need to provide it as a children because we cannot import directly in client component
1616
*/
1717
export const usePlanCta = (downloadButton?: React.ReactNode) => {
1818
const posthog = usePostHog();
1919

20-
return useCallback((tierCode: string, account: AccountStore, waitingForPurchase: boolean, planCycle: string) => {
20+
return useCallback((tierCode: string, account: AccountStore, waitingForPurchase: boolean, planCycle: Interval) => {
2121
const { paidTier, paidCycle } = account.subscription;
2222

2323
if (waitingForPurchase) {

src/components/sections/pricing/plans/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { observer } from 'mobx-react-lite';
44
import { useCallback, useState } from 'react';
5-
import { Interval } from '@httptoolkit/accounts';
65

76
import { PricingCard } from './components/card';
87
import { LoginInfo } from './components/login-info';
@@ -21,7 +20,7 @@ import type { PlanId, StyledPricingPlansProps } from './plans.types';
2120

2221
import { Spinner } from '@/components/elements/icon';
2322
import { Text } from '@/components/elements/text';
24-
import { accountStore } from '@/lib/store/account-store';
23+
import { accountStore, Interval } from '@/lib/store/account-store';
2524

2625
const LoadingPrice = () => {
2726
return (

src/lib/store/account-store.js

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)