Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 790904d

Browse files
committed
wip
1 parent 3dc75ba commit 790904d

38 files changed

Lines changed: 812 additions & 847 deletions

App.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { SafeAreaProvider } from "react-native-safe-area-context"
2121
import { ThirdwebProvider } from "thirdweb/react"
2222
import { base } from "viem/chains"
2323
// import { DevToolsBubble } from "react-native-react-query-devtools"
24+
import { ConditionalWrapper } from "@/components/conditional-wrapper"
2425
import { captureError } from "@/utils/capture-error"
2526
import { setupConvosApi } from "@/utils/convos-api/convos-api-init"
2627
import { ReactQueryPersistProvider } from "@/utils/react-query/react-query-persist-provider"
@@ -81,7 +82,10 @@ export function App() {
8182
<ActionSheetProvider>
8283
<ThemeProvider value={{ themeScheme, setThemeContextOverride }}>
8384
<GestureHandlerRootView style={$globalStyles.flex1}>
84-
<DebugProvider>
85+
<ConditionalWrapper
86+
condition={config.debugMenu}
87+
wrapper={(children) => <DebugProvider>{children}</DebugProvider>}
88+
>
8589
<BottomSheetModalProvider>
8690
{/* <AuthenticateWithPasskeyProvider> */}
8791
<AppNavigator />
@@ -90,7 +94,7 @@ export function App() {
9094
<Snackbars />
9195
<ActionSheet />
9296
</BottomSheetModalProvider>
93-
</DebugProvider>
97+
</ConditionalWrapper>
9498
</GestureHandlerRootView>
9599
</ThemeProvider>
96100
</ActionSheetProvider>

app.config.ts

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import { version } from "./package.json"
44
type Environment = "development" | "preview" | "production"
55

66
type EnvironmentConfig = {
7-
scheme: string
8-
androidPackage: string
9-
domain: string
107
appName: string
8+
scheme: string
9+
webDomain: string
1110
icon: string
1211
ios: {
1312
bundleIdentifier: string
@@ -18,13 +17,18 @@ type EnvironmentConfig = {
1817
package: string
1918
googleServicesFile: string
2019
}
21-
alchemyApiKey: string
2220
}
2321

24-
// Type assertion for process.env to include our Expo public variables
25-
const env = process.env as {
26-
EXPO_PUBLIC_ALCHEMY_API_KEY?: string
27-
EXPO_ENV?: string
22+
export type IExpoAppConfigExtra = {
23+
webDomain: string
24+
expoEnv: Environment
25+
eas: {
26+
projectId: string
27+
}
28+
}
29+
30+
type ICustomExpoConfig = ExpoConfig & {
31+
extra: IExpoAppConfigExtra
2832
}
2933

3034
const settings: Record<Environment, EnvironmentConfig> = {
@@ -39,11 +43,9 @@ const settings: Record<Environment, EnvironmentConfig> = {
3943
package: "com.convos.dev",
4044
googleServicesFile: "./google-services/android/development.json",
4145
},
42-
androidPackage: "com.convos.dev",
43-
domain: "dev.convos.org",
44-
appName: "Convos DEV",
46+
webDomain: "dev.convos.org",
47+
appName: "Convos Dev",
4548
icon: "./assets/icon-preview.png",
46-
alchemyApiKey: env.EXPO_PUBLIC_ALCHEMY_API_KEY || "",
4749
},
4850
preview: {
4951
scheme: "convos-preview",
@@ -56,11 +58,9 @@ const settings: Record<Environment, EnvironmentConfig> = {
5658
package: "com.convos.preview",
5759
googleServicesFile: "./google-services/android/preview.json",
5860
},
59-
androidPackage: "com.convos.preview",
60-
domain: "preview.convos.org",
61-
appName: "Convos PREVIEW",
61+
webDomain: "preview.convos.org",
62+
appName: "Convos Preview",
6263
icon: "./assets/icon-preview.png",
63-
alchemyApiKey: env.EXPO_PUBLIC_ALCHEMY_API_KEY || "",
6464
},
6565
production: {
6666
scheme: "convos",
@@ -73,18 +73,17 @@ const settings: Record<Environment, EnvironmentConfig> = {
7373
package: "com.convos.prod",
7474
googleServicesFile: "./google-services/android/production.json",
7575
},
76-
androidPackage: "com.convos.prod",
77-
domain: "convos.org",
76+
webDomain: "convos.org",
7877
appName: "Convos",
7978
icon: "./assets/icon.png",
80-
alchemyApiKey: env.EXPO_PUBLIC_ALCHEMY_API_KEY || "",
8179
},
8280
}
8381

84-
export default (): ExpoConfig => {
82+
export default () => {
8583
const expoEnv = (process.env.EXPO_ENV || "development") as Environment
8684
const config = settings[expoEnv]
8785

86+
// Add "as CustomExpoConfig" here to type the entire config object
8887
return {
8988
name: config.appName,
9089
scheme: config.scheme,
@@ -102,6 +101,7 @@ export default (): ExpoConfig => {
102101
url: "https://u.expo.dev/f9089dfa-8871-4aff-93ea-da08af0370d2",
103102
},
104103
extra: {
104+
webDomain: config.webDomain,
105105
expoEnv,
106106
eas: {
107107
projectId: "f9089dfa-8871-4aff-93ea-da08af0370d2",
@@ -145,7 +145,7 @@ export default (): ExpoConfig => {
145145
{
146146
action: "VIEW",
147147
category: ["DEFAULT", "BROWSABLE"],
148-
data: [{ scheme: config.scheme }, { scheme: config.androidPackage }],
148+
data: [{ scheme: config.scheme }, { scheme: config.android.package }],
149149
},
150150
{
151151
autoVerify: true,
@@ -154,22 +154,27 @@ export default (): ExpoConfig => {
154154
data: [
155155
{
156156
scheme: "https",
157-
host: config.domain,
157+
host: config.webDomain,
158+
pathPrefix: "/coinbase",
159+
},
160+
{
161+
scheme: "https",
162+
host: config.webDomain,
158163
pathPrefix: "/",
159164
},
160165
{
161166
scheme: "https",
162-
host: config.domain,
167+
host: config.webDomain,
163168
pathPrefix: "/dm",
164169
},
165170
{
166171
scheme: "https",
167-
host: config.domain,
172+
host: config.webDomain,
168173
pathPrefix: "/group-invite",
169174
},
170175
{
171176
scheme: "https",
172-
host: config.domain,
177+
host: config.webDomain,
173178
pathPrefix: "/group",
174179
},
175180
],
@@ -311,5 +316,5 @@ export default (): ExpoConfig => {
311316
["@react-native-firebase/app-check"],
312317
"./scripts/android/build/android-deps-expo-plugin.js",
313318
],
314-
}
319+
} as ICustomExpoConfig
315320
}

components/debug-provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ function useShowDebugMenu() {
566566

567567
showActionSheet({
568568
options: {
569-
title: `Convos v${config.appVersion}`,
569+
title: `Convos v${config.app.version}`,
570570
options,
571571
cancelButtonIndex: options.indexOf("Cancel"),
572572
},

config/config.types.ts

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,39 @@
1-
// import { IXmtpEnv } from "@/utils/xmtpRN/xmtp.types";
2-
31
import type { IXmtpEnv } from "@/features/xmtp/xmtp.types"
42

5-
type IEvmConfig = {
6-
rpcEndpoint: string
7-
transactionChainId: string
8-
USDC: {
9-
contractAddress: string
10-
name: string
11-
version: string
12-
decimals: number
13-
}
14-
}
15-
16-
type IPrivyConfig = {
17-
appId: string
18-
clientId: string
19-
}
20-
213
export type ILoggerColorScheme = "light" | "dark"
224

235
export type IConfig = {
24-
appName: string
25-
appVersion: string
26-
appStoreUrl: string
276
loggerColorScheme: ILoggerColorScheme
28-
debugMenu: boolean
29-
debugAddresses: string[]
30-
lensApiDomain: string
31-
lensSuffix: string
32-
sentryDSN: string
33-
framesAllowedSchemes: ("http" | "https" | "ethereum")[]
34-
thirdwebClientId: string
35-
xmtpEnv: IXmtpEnv
36-
apiURI: string
37-
bundleId: string
38-
scheme: string
39-
websiteDomain: string
40-
usernameSuffix: string
417
reactQueryPersistCacheIsEnabled: boolean
42-
universalLinks: string[]
43-
privy: IPrivyConfig
44-
evm: IEvmConfig
45-
appCheckDebugToken: string | undefined
46-
reactQueryEncryptionKey: string
8+
debugMenu: boolean
9+
app: {
10+
name: string
11+
version: string
12+
storeUrl: string
13+
bundleId: string
14+
scheme: string
15+
universalLinks: string[]
16+
apiUrl: string
17+
webDomain: string
18+
}
19+
firebase: {
20+
appCheckDebugToken: string
21+
}
22+
sentry: {
23+
dsn: string
24+
}
25+
thirdweb: {
26+
clientId: string
27+
}
28+
privy: {
29+
appId: string
30+
clientId: string
31+
}
32+
evm: {
33+
rpcEndpoint: string
34+
}
4735
xmtp: {
36+
env: IXmtpEnv
4837
maxMsUntilLogError: number
4938
}
5039
}

config/development.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,4 @@ import { shared } from "./shared"
33

44
export const developmentConfig: IConfig = {
55
...shared,
6-
appStoreUrl: "",
7-
debugMenu: true,
8-
bundleId: "com.converse.dev",
9-
scheme: "converse-dev",
10-
websiteDomain: "dev.converse.xyz",
11-
usernameSuffix: ".conversedev.eth",
12-
universalLinks: ["dev.converse.xyz/", "dev.getconverse.app/"].flatMap((domain) => [
13-
`https://${domain}`,
14-
`http://${domain}`,
15-
domain,
16-
]),
17-
evm: {
18-
rpcEndpoint: process.env.EXPO_PUBLIC_EVM_RPC_ENDPOINT,
19-
transactionChainId: "0x14a34", // Base Sepolia
20-
USDC: {
21-
contractAddress: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
22-
name: "USDC",
23-
version: "2",
24-
decimals: 6,
25-
},
26-
},
27-
reactQueryEncryptionKey: process.env.EXPO_PUBLIC_SECURE_REACT_QUERY_ENCRYPTION_KEY || "",
286
} as const

config/preview.ts

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,11 @@ import { shared } from "./shared"
44

55
export const previewConfig: IConfig = {
66
...shared,
7-
debugMenu: true,
8-
appStoreUrl: Platform.select({
9-
default: "itms-beta://testflight.apple.com/v1/app/6478027666",
10-
android: "https://play.google.com/apps/internaltest/4701737988037557150",
11-
}),
12-
bundleId: "com.converse.preview",
13-
scheme: "converse-preview",
14-
websiteDomain: "preview.converse.xyz",
15-
usernameSuffix: ".conversedev.eth",
16-
universalLinks: ["preview.converse.xyz/", "preview.getconverse.app/"].flatMap((domain) => [
17-
`https://${domain}`,
18-
`http://${domain}`,
19-
domain,
20-
]),
21-
evm: {
22-
rpcEndpoint: process.env.EXPO_PUBLIC_EVM_RPC_ENDPOINT,
23-
transactionChainId: "0x14a34", // Base Sepolia
24-
USDC: {
25-
contractAddress: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
26-
name: "USDC",
27-
version: "2",
28-
decimals: 6,
29-
},
7+
app: {
8+
...shared.app,
9+
storeUrl: Platform.select({
10+
default: "itms-beta://testflight.apple.com/v1/app/6478027666",
11+
android: "https://play.google.com/apps/internaltest/4701737988037557150",
12+
}),
3013
},
3114
} as const

config/production.ts

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,12 @@ import { shared } from "./shared"
44

55
export const productionConfig: IConfig = {
66
...shared,
7-
appStoreUrl: Platform.select({
8-
default: "TODO",
9-
android: "TODO",
10-
}),
11-
bundleId: Platform.OS === "android" ? "com.converse.prod" : "com.converse.native",
12-
scheme: "converse",
13-
websiteDomain: "converse.xyz",
14-
usernameSuffix: ".converse.xyz",
15-
universalLinks: ["converse.xyz/", "getconverse.app/"].flatMap((domain) => [
16-
`https://${domain}`,
17-
`http://${domain}`,
18-
domain,
19-
]),
20-
evm: {
21-
rpcEndpoint: process.env.EXPO_PUBLIC_EVM_RPC_ENDPOINT,
22-
transactionChainId: "0x2105", // Base Mainnet
23-
USDC: {
24-
contractAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
25-
name: "USD Coin",
26-
version: "2",
27-
decimals: 6,
28-
},
7+
debugMenu: false,
8+
app: {
9+
...shared.app,
10+
storeUrl: Platform.select({
11+
default: "TODO",
12+
android: "TODO",
13+
}),
2914
},
3015
} as const

0 commit comments

Comments
 (0)