Skip to content

Commit

Permalink
feat: Add 3 emails/mo free trial
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 31, 2023
1 parent 3a499a9 commit 5ead886
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/app/[lang]/dashboard/ApiUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { createClient } from "@/supabase/client";

interface ApiUsageProps {
d: Dictionary;
subscription: SubscriptionWithPrice;
subscription: SubscriptionWithPrice | null;
}

export function ApiUsage({
Expand Down
2 changes: 1 addition & 1 deletion src/app/[lang]/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function Dashboard({
<Page>
<SubscriptionHeader d={d} subscription={subscription} />
<Spacer h={2} />
{showApiUsage && subscription && (
{showApiUsage && (
<>
<ApiUsage d={d} subscription={subscription} />
<Spacer h={2} />
Expand Down
20 changes: 0 additions & 20 deletions src/app/[lang]/dashboard/verify/GetStartedNoPlan.tsx

This file was deleted.

20 changes: 9 additions & 11 deletions src/app/[lang]/dashboard/verify/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
getSubscription,
getUserDetails,
} from "@/supabase/supabaseServer";
import { GetStartedNoPlan } from "./GetStartedNoPlan";
import { GetStartedApi } from "./GetStartedApi";
import { dictionary } from "@/dictionaries";
import { Spacer } from "@/components/Geist";
Expand All @@ -27,16 +26,15 @@ export default async function VerifySingle({
const d = await dictionary(lang);

return (
<Dashboard d={d} subscription={subscription} tab="verify">
{subscription ? (
<>
<GetStartedSaaS userDetails={userDetails} d={d} />
<Spacer />
<GetStartedApi userDetails={userDetails} d={d} />
</>
) : (
<GetStartedNoPlan d={d} />
)}
<Dashboard
showApiUsage={true}
d={d}
subscription={subscription}
tab="verify"
>
<GetStartedSaaS userDetails={userDetails} d={d} />
<Spacer />
<GetStartedApi userDetails={userDetails} d={d} />
</Dashboard>
);
}
1 change: 1 addition & 0 deletions src/app/[lang]/login/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function Feedback({
<Select.Option value="blog-du-modérateur">
Blog du Modérateur
</Select.Option>
<Select.Option value="facebook">Facebook</Select.Option>
<Select.Option value="other">{d.other}</Select.Option>
</Select>

Expand Down
5 changes: 3 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export const config = {
* - favicon (favicon file)
* - monitoring (health check)
* - js (JavaScript files)
* - v0,v1 (API routes)
* - v0,v1 (api.reacher.email/v0/...)
* - version (api.reacher.email/version)
*/
"/((?!api|_next/static|_next/image|favicon|monitoring|js|v0|v1).*)",
"/((?!api|_next/static|_next/image|favicon|monitoring|js|v0|v1|version).*)",
],
};

Expand Down
4 changes: 2 additions & 2 deletions src/util/subs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ if (
}

// Return the max monthly calls
export function subApiMaxCalls(productId: string | null): number {
export function subApiMaxCalls(productId: string | null | undefined): number {
return productId === SAAS_100K_PRODUCT_ID
? 100_000
: productId === SAAS_10K_PRODUCT_ID
? 10_000
: 50;
: 3;
}

// Get the api calls of a user in the past month/billing period.
Expand Down

1 comment on commit 5ead886

@vercel
Copy link

@vercel vercel bot commented on 5ead886 Dec 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.