Skip to content

Commit

Permalink
Cleanup pricing components
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilgeorgescu authored Oct 28, 2024
1 parent a7c093c commit 812b102
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/components/MembershipPricing.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { getCollection, getEntry } from "astro:content";
<!-- ---
import { getCollection,getEntry } from "astro:content";
// const { course } = Astro.props;
// const { price, benefits, title } = course.data;
Expand Down Expand Up @@ -316,4 +316,4 @@ const membershipLinesOfCode = (await getCollection("courses"))
>Join Now</a
>
</div>
</div>
</div> -->
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ const membershipTypes = [
{ value: "Yearly", label: "Yearly", priceSuffix: "/year" },
];

interface CallbackArgs {
pricingPlanId: number;
func: React.Dispatch;
errorFunc: React.Dispatch;
loadingFunc: React.Dispatch;
}

// const plans = [
// {
// id: "5",
Expand All @@ -46,11 +39,11 @@ export default function Example(props) {
const [monthlyPrice, setMonthlyPrice] = useState("Free");
const [yearlyPrice, setYearlyPrice] = useState("Free");
const [monthlyLoading, setMonthlyLoading] = useState(true);
const [monthlyError, setMonthlyError] = useState<string | null>(null);
const [monthlyError, setMonthlyError] = useState(null);
const [yearlyLoading, setYearlyLoading] = useState(true);
const [yearlyError, setYearlyError] = useState<string | null>(null);
const [yearlyError, setYearlyError] = useState(null);

const getCoursePrice = useCallback(async (args: CallbackArgs) => {
const getCoursePrice = useCallback(async (args) => {
// setLoading(true);
// setError(null);
try {
Expand Down
9 changes: 4 additions & 5 deletions src/components/MembershipTeamPricing.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { getCollection, getEntry } from "astro:content";
<!-- ---
import { getCollection,getEntry } from "astro:content";
// const { course } = Astro.props;
// const { price, benefits, title } = course.data;
Expand Down Expand Up @@ -28,8 +28,7 @@ const membershipLinesOfCode = (await getCollection("courses"))
// const categories = (await getCollection("courseCategories")).sort((a, b) =>
// a.data.ordinal <= b.data.ordinal ? -1 : 1,
// );
---

--- --><!--
<div
class="mx-auto mt-16 grid max-w-lg grid-cols-1 items-center gap-y-6 sm:mt-20 sm:gap-y-0 lg:max-w-4xl lg:grid-cols-2"
>
Expand Down Expand Up @@ -311,4 +310,4 @@ const membershipLinesOfCode = (await getCollection("courses"))
>Join Now</a
>
</div>
</div>
</div> -->
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { getCollection, getEntry } from "astro:content";
const membership = await getEntry("memberships", "personal");
const monthlyPriceId = membership.data.packages[0].pricingPlanId;
const monthlyPriceId = membership?.data.packages[0].pricingPlanId;
const monthlyTitle = "Monthly Membership";
const yearlyPriceId = membership.data.packages[1].pricingPlanId;
const yearlyPriceId = membership?.data.packages[1].pricingPlanId;
const yearlyTitle = "Yearly Membership";
const membershipHours = (await getCollection("courses"))
Expand All @@ -23,7 +23,6 @@ const membershipLinesOfCode = (await getCollection("courses"))
---

<Section color="bg-secondary" title="Get started now!">
<!-- <MembershipPricing /> -->
<MembershipPricingHelper
{monthlyTitle}
{monthlyPriceId}
Expand Down

0 comments on commit 812b102

Please sign in to comment.