@pylonsync/create-pylon 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/backend/mobile/apps/api/README.md +20 -1
- package/templates/backend/mobile/apps/api/app/(site)/layout.tsx +103 -0
- package/templates/backend/mobile/apps/api/app/(site)/not-found.tsx +23 -0
- package/templates/backend/mobile/apps/api/app/(site)/page.tsx +221 -0
- package/templates/backend/mobile/apps/api/app/(site)/privacy/page.tsx +131 -0
- package/templates/backend/mobile/apps/api/app/(site)/support/page.tsx +78 -0
- package/templates/backend/mobile/apps/api/app/(site)/terms/page.tsx +144 -0
- package/templates/backend/mobile/apps/api/app/error.tsx +27 -0
- package/templates/backend/mobile/apps/api/app/globals.css +87 -0
- package/templates/backend/mobile/apps/api/app/layout.tsx +27 -0
- package/templates/backend/mobile/apps/api/app/robots.ts +13 -0
- package/templates/backend/mobile/apps/api/app/sitemap.ts +16 -0
- package/templates/backend/mobile/apps/api/app.ts +6 -2
- package/templates/backend/mobile/apps/api/components/legal.tsx +64 -0
- package/templates/backend/mobile/apps/api/lib/site.ts +94 -0
- package/templates/backend/mobile/apps/api/package.json +8 -1
- package/templates/backend/mobile/apps/api/tsconfig.json +6 -2
- package/templates/expo/mobile/apps/expo/.env.example +13 -4
- package/templates/expo/mobile/apps/expo/README.md +9 -0
- package/templates/expo/mobile/apps/expo/STORE.md +9 -5
- package/templates/expo/mobile/apps/expo/app/(tabs)/settings.tsx +9 -6
- package/templates/expo/mobile/apps/expo/app/paywall.tsx +9 -13
- package/templates/expo/mobile/apps/expo/src/links.ts +29 -0
|
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
import { Alert, Linking, Pressable, Text, View } from "react-native";
|
|
3
3
|
import { useLocalSearchParams, useRouter } from "expo-router";
|
|
4
4
|
import { track } from "@/analytics";
|
|
5
|
+
import { PRIVACY_URL, TERMS_URL } from "@/links";
|
|
5
6
|
import { usePro } from "@/entitlements";
|
|
6
7
|
import { available, offers, purchase, restore, type Offer } from "@/purchases";
|
|
7
8
|
import { radius, space, useTheme } from "@/theme";
|
|
@@ -45,8 +46,7 @@ export default function Paywall() {
|
|
|
45
46
|
if (pro) router.back();
|
|
46
47
|
}, [pro, router]);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
const terms = process.env.EXPO_PUBLIC_TERMS_URL;
|
|
49
|
+
|
|
50
50
|
|
|
51
51
|
async function buy() {
|
|
52
52
|
const offer = list?.find((o) => o.id === selected);
|
|
@@ -160,17 +160,13 @@ export default function Paywall() {
|
|
|
160
160
|
<Button title="Restore purchases" variant="ghost" loading={busy === "restore"} onPress={() => void restorePurchases()} />
|
|
161
161
|
<Text style={{ color: t.muted, fontSize: 11, textAlign: "center", lineHeight: 16, marginTop: space.sm }}>
|
|
162
162
|
Renews automatically until cancelled. Manage in your store account settings.{" "}
|
|
163
|
-
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<Text style={{ textDecorationLine: "underline" }} onPress={() => void Linking.openURL(privacy)}>
|
|
171
|
-
Privacy
|
|
172
|
-
</Text>
|
|
173
|
-
) : null}
|
|
163
|
+
<Text style={{ textDecorationLine: "underline" }} onPress={() => void Linking.openURL(TERMS_URL)}>
|
|
164
|
+
Terms
|
|
165
|
+
</Text>
|
|
166
|
+
{" · "}
|
|
167
|
+
<Text style={{ textDecorationLine: "underline" }} onPress={() => void Linking.openURL(PRIVACY_URL)}>
|
|
168
|
+
Privacy
|
|
169
|
+
</Text>
|
|
174
170
|
</Text>
|
|
175
171
|
</Screen>
|
|
176
172
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the app sends people for legal text and help.
|
|
3
|
+
*
|
|
4
|
+
* The backend in `apps/api` serves a website as well as the API, so these
|
|
5
|
+
* pages already exist on whatever host `EXPO_PUBLIC_PYLON_BASE_URL` points
|
|
6
|
+
* at. That is what makes the App Store and Play Store requirements
|
|
7
|
+
* satisfiable straight from a scaffold: both stores refuse a submission
|
|
8
|
+
* without a reachable privacy policy URL.
|
|
9
|
+
*
|
|
10
|
+
* Set the EXPO_PUBLIC_* values only if you host the marketing site somewhere
|
|
11
|
+
* else, on your own domain for example.
|
|
12
|
+
*/
|
|
13
|
+
import { PYLON_BASE_URL } from "./pylon";
|
|
14
|
+
|
|
15
|
+
const siteOrigin = (
|
|
16
|
+
process.env.EXPO_PUBLIC_SITE_URL || PYLON_BASE_URL
|
|
17
|
+
).replace(/\/+$/, "");
|
|
18
|
+
|
|
19
|
+
export const PRIVACY_URL =
|
|
20
|
+
process.env.EXPO_PUBLIC_PRIVACY_URL || `${siteOrigin}/privacy`;
|
|
21
|
+
|
|
22
|
+
export const TERMS_URL =
|
|
23
|
+
process.env.EXPO_PUBLIC_TERMS_URL || `${siteOrigin}/terms`;
|
|
24
|
+
|
|
25
|
+
export const SUPPORT_URL =
|
|
26
|
+
process.env.EXPO_PUBLIC_SUPPORT_URL || `${siteOrigin}/support`;
|
|
27
|
+
|
|
28
|
+
/** Optional. Settings shows a "Contact support" row when it is set. */
|
|
29
|
+
export const SUPPORT_EMAIL = process.env.EXPO_PUBLIC_SUPPORT_EMAIL;
|