File tree Expand file tree Collapse file tree 4 files changed +21
-13
lines changed
components/pricing/PricingOverview Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { redirect } from "next/navigation";
3
3
import { auth } from "auth" ;
4
4
import { PricingOverview } from "components/pricing" ;
5
5
import { app } from "lib/config" ;
6
- import { polar } from "lib/polar" ;
6
+ import { BACKFEED_PRODUCT_IDS , polar } from "lib/polar" ;
7
7
8
8
export const dynamic = "force-dynamic" ;
9
9
@@ -23,9 +23,8 @@ const PricingPage = async () => {
23
23
] = await Promise . all ( [
24
24
auth ( ) ,
25
25
polar . products . list ( {
26
- isArchived : false ,
27
- // ! NB: important that the product name includes this query string (i.e. Backfeed)
28
- query : app . name ,
26
+ id : BACKFEED_PRODUCT_IDS ,
27
+ sorting : [ "price_amount" ] ,
29
28
} ) ,
30
29
] ) ;
31
30
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import { app } from "lib/config";
20
20
import { useSearchParams } from "lib/hooks" ;
21
21
22
22
import type { Product } from "@polar-sh/sdk/models/components/product" ;
23
- import type { ProductPriceFixed } from "@polar-sh/sdk/models/components/productpricefixed" ;
24
23
25
24
interface Props {
26
25
/** The products available for pricing tiers. */
@@ -35,14 +34,7 @@ const PricingOverview = ({ products }: Props) => {
35
34
36
35
const filteredProducts = useMemo (
37
36
( ) =>
38
- products
39
- . filter ( ( product ) => product . recurringInterval === pricingModel )
40
- // ! NB: this sort function is limited. Prices must fall in the `fixed` price type. May need to adjust accordingly in the future.
41
- . sort (
42
- ( a , b ) =>
43
- ( a . prices [ 0 ] as ProductPriceFixed ) . priceAmount -
44
- ( b . prices [ 0 ] as ProductPriceFixed ) . priceAmount ,
45
- ) ,
37
+ products . filter ( ( product ) => product . recurringInterval === pricingModel ) ,
46
38
[ products , pricingModel ] ,
47
39
) ;
48
40
Original file line number Diff line number Diff line change 1
1
export { default as polar } from "./polar" ;
2
+ export { default as BACKFEED_PRODUCT_IDS } from "./productIds" ;
Original file line number Diff line number Diff line change
1
+ const BACKFEED_PRODUCT_IDS : string [ ] = [
2
+ "9fdf9d78-f4f7-4222-93ed-55ae60d996e4" , // Backfeed Basic (Monthly) sandbox
3
+ "9a135ea6-5e7c-448b-8070-a5534ae72d93" , // Backfeed Basic (Yearly) sandbox
4
+ "51eaf279-48b4-422a-939f-046cb299655d" , // Backfeed Team (Monthly) sandbox
5
+ "2479fd7f-03b3-4965-9887-e701e8e18e14" , // Backfeed Team (Yearly) sandbox
6
+ "3776b994-1c73-4869-afef-f34a2ca68181" , // Backfeed Enterprise (Monthly) sandbox
7
+ "48d27c97-50da-441b-ba44-d90b8c2d60b3" , // Backfeed Enterprise (Yearly) sandbox
8
+ "768e1aee-fc38-46fa-91d9-1c15b71375dd" , // Backfeed Basic (Monthly) prod
9
+ "a35183cc-5223-4e64-852c-a291a6f52222" , // Backfeed Basic (Yearly) prod
10
+ "b1f48ae5-0de4-416e-9b16-39b3f01372b6" , // Backfeed Team (Monthly) prod
11
+ "39e6bf3d-0aef-4fe0-abdb-243af14b010f" , // Backfeed Team (Yearly) prod
12
+ "7e2bd7d7-6a43-4c0d-8545-c59d2fabd598" , // Backfeed Enterprise (Monthly) prod
13
+ "51906ba1-b6a9-43c9-83ee-f2fe399a792f" , // Backfeed Enterprise (Yearly) prod
14
+ ] as const ;
15
+
16
+ export default BACKFEED_PRODUCT_IDS ;
You can’t perform that action at this time.
0 commit comments