Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mobile app architecture and initial screens #2144

Merged
merged 168 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
007954d
feat: initialize mobile app with Expo setup and configuration
lawvs Dec 13, 2024
f9e15c2
chore: update deps
lawvs Dec 13, 2024
a3bf0e4
feat: update layout and integrate WebView for follow
lawvs Dec 13, 2024
738148a
Merge branch 'dev' into feat/mobile
hyoban Dec 13, 2024
2cc70bd
chore: update lock
hyoban Dec 13, 2024
3401a09
chore: lint
hyoban Dec 13, 2024
bfd857f
Merge branch 'dev' into feat/mobile
hyoban Dec 13, 2024
129cc40
chore: lock file
hyoban Dec 13, 2024
9704f61
feat: login with deeplink
hyoban Dec 13, 2024
c37c234
feat: auth
hyoban Dec 13, 2024
bd054aa
feat: add Expo development script and refactor mobile app configuration
Innei Dec 13, 2024
66e1f73
feat: update dependencies and enhance mobile app configuration
Innei Dec 13, 2024
9387e9e
refactor: streamline color configuration and enhance authentication UI
Innei Dec 13, 2024
728623e
feat: add tab
Innei Dec 13, 2024
975ea3e
feat: add new icons and update mobile app configuration
Innei Dec 13, 2024
e355cf6
chore: init debug screen
Innei Dec 15, 2024
5214236
feat: app route layer
Innei Dec 15, 2024
9ae3858
feat: enhance mobile app layout and navigation
Innei Dec 15, 2024
358b015
fix: navigation theme
Innei Dec 15, 2024
8b8c508
refactor: update layout components and streamline navigation
Innei Dec 15, 2024
0037b5a
feat: update dependencies and refactor mobile app components
Innei Dec 15, 2024
7c6b29a
feat: integrate React Native Bottom Tabs
hyoban Dec 16, 2024
e937047
refactor: use native bottom tab
hyoban Dec 16, 2024
93f4e4b
chore: jsx preserve for ts config
hyoban Dec 16, 2024
8bc8036
Revert "refactor: use native bottom tab"
Innei Dec 16, 2024
7bc38df
feat: enhance tab bar icons in TabLayout
Innei Dec 16, 2024
508ad0d
feat: add withFollowAssets plugin for managing asset resources
lawvs Dec 16, 2024
cce048c
feat: add FollowWebView component
lawvs Dec 16, 2024
5a608e5
chore: set base path to current directory in vite config
lawvs Dec 16, 2024
eb3c0ca
refactor: rename withFollowAssets.js to with-follow-assets.js and add…
lawvs Dec 16, 2024
41b1891
Merge branch 'dev' into feat/mobile
hyoban Dec 17, 2024
312b08b
Merge branch 'dev' into feat/mobile
hyoban Dec 17, 2024
77c2cff
feat: debug for webview
Innei Dec 17, 2024
da75b9f
chore(lint): correct tailwind config for mobile
hyoban Dec 17, 2024
38ca8cb
fix: share cookie with webview
hyoban Dec 17, 2024
3c77a04
fix: redirect to home for webview
hyoban Dec 17, 2024
b34becb
fix: bring cookie inject back
hyoban Dec 17, 2024
5409242
feat: init db
Innei Dec 17, 2024
a33b3e6
fix: inject js
hyoban Dec 17, 2024
ba70473
fix: add shared env
Innei Dec 17, 2024
b4aa351
feat: useAuthCookie
hyoban Dec 17, 2024
2a5dba9
fix: save token
hyoban Dec 17, 2024
79433a8
chore: update icon
hyoban Dec 17, 2024
5441e0a
chore: add note
hyoban Dec 17, 2024
09ad94f
feat: init auth client
hyoban Dec 17, 2024
9709651
feat: simple auth flow
hyoban Dec 17, 2024
0b92bf7
refactor: use cookie-es
hyoban Dec 17, 2024
23e9a82
chore: remove unstable_enablePackageExports
hyoban Dec 17, 2024
a3f3824
chore: remove auth page
hyoban Dec 17, 2024
ff7444d
chore: update dependencies and refactor storage management
Innei Dec 17, 2024
858a19b
chore: update dependencies and add subscriptions schema
Innei Dec 17, 2024
5832b0b
chore: remove unused config
hyoban Dec 18, 2024
437fa4b
chore: remove unused code
hyoban Dec 18, 2024
87fb766
chore: signout for debug
hyoban Dec 18, 2024
1485244
refactor: use kv as auth storage
hyoban Dec 18, 2024
d28db25
chore: remove expo-secure-store, see https://github.com/better-auth/b…
hyoban Dec 18, 2024
5cd8467
fix: logout from native
hyoban Dec 18, 2024
bba3ab9
feat: react-hook-form
hyoban Dec 18, 2024
eef131e
feat: simple ui
hyoban Dec 18, 2024
2c58f2e
chore: auto-fix linting and formatting issues
hyoban Dec 18, 2024
5226314
feat: sn pro font
hyoban Dec 18, 2024
80c9fde
chore: auto-fix linting and formatting issues
hyoban Dec 18, 2024
e1dbdbf
feat: enhance database schema and API error handling; improve feed li…
Innei Dec 18, 2024
5fbb462
feat: update ThemedBlurView and enhance feed list with new subscripti…
Innei Dec 18, 2024
fde99c2
chore: remove login url env
hyoban Dec 18, 2024
4adb19c
feat: implement navigation handling in FollowWebView
lawvs Dec 18, 2024
cc92051
feat: make social login work
hyoban Dec 18, 2024
974947f
chore: update
hyoban Dec 18, 2024
8f9942d
feat: update environment variables, add dayjs dependency, enhance dat…
Innei Dec 18, 2024
cf09232
feat: enhance tab layout and feed list with improved ThemedBlurView i…
Innei Dec 18, 2024
78ef3b8
refactor: move video URL handling to utils
lawvs Dec 18, 2024
8b60190
feat: integrate utility functions for URL handling in FollowWebView
lawvs Dec 18, 2024
5d41f0b
chore: update lock
lawvs Dec 18, 2024
fbaa6d0
fix: workaround potential null value in remoteSettings.updated
lawvs Dec 18, 2024
2182a5f
feat: enhance FeedList layout with dynamic header and tab height adju…
Innei Dec 18, 2024
6c83a89
chore: update dependencies and configure babel-plugin-module-resolver
Innei Dec 18, 2024
8f707a0
feat: enhance database integration and add SQL support
Innei Dec 18, 2024
efe2aba
feat: enhance database functionality
Innei Dec 18, 2024
201983c
feat: implement session token management and enhance DebugPanel
Innei Dec 18, 2024
810a3b1
fix: handle keyboard
hyoban Dec 18, 2024
9c5574d
feat: enhance layout and subscription service functionality
Innei Dec 18, 2024
5c8c4a4
refactor: update FeedList component with improved pressable interacti…
Innei Dec 18, 2024
f02f5aa
Merge branch 'dev' into feat/mobile
Innei Dec 18, 2024
8c96ec2
chore: reduce bundle size
Innei Dec 19, 2024
b0fa06a
fix: cookie
hyoban Dec 19, 2024
06c8485
fix: cookie name
hyoban Dec 19, 2024
96d0754
fix: update iOS URI for FollowWebView
lawvs Dec 19, 2024
4813e8b
chore: eas link
Innei Dec 19, 2024
ac1aa32
Merge branch 'dev' into feat/mobile
hyoban Dec 19, 2024
75e8030
chore: update @better-auth/expo
hyoban Dec 19, 2024
1364ce3
chore: format
hyoban Dec 19, 2024
306606f
chore: fix can not click debug button
hyoban Dec 19, 2024
45e0afc
chore: add expo-drizzle-studio-plugin
hyoban Dec 19, 2024
a4eae6e
chore: turn off typechecked rules in eslint
hyoban Dec 19, 2024
a9fb442
chore: pan debug button
Innei Dec 19, 2024
11b6b01
fix: dark mode in rn webview
hyoban Dec 19, 2024
592e5ea
chore: update
hyoban Dec 19, 2024
ed4ee86
fix: detect safari in webview
hyoban Dec 19, 2024
a876c00
fix: try fix db init
Innei Dec 19, 2024
4a384bb
refactor: adjust layout and improve tab view in FeedList component
Innei Dec 19, 2024
93ce969
refactor: simplify FeedList component by removing unused code and opt…
Innei Dec 19, 2024
7458b38
refactor: enhance subscription sorting in useSubscriptionByView hook
Innei Dec 19, 2024
80f19ed
refactor: data schemas and improve feed and subscription handling
Innei Dec 19, 2024
7821301
chore: auto-fix linting and formatting issues
Innei Dec 19, 2024
5dc7f8c
fix: enhance FeedIcon styling for dark mode compatibility
Innei Dec 19, 2024
d054db3
chore: auto-fix linting and formatting issues
Innei Dec 19, 2024
9724d54
feat: enhance FeedList component with animated accordion for grouped …
Innei Dec 19, 2024
cb8a510
chore: auto-fix linting and formatting issues
Innei Dec 19, 2024
b7352d7
refactor: update database schema and migration files
Innei Dec 19, 2024
1d7b182
chore: auto-fix linting and formatting issues
Innei Dec 19, 2024
740a3e5
feat: enhance FeedList component with ItemPressable for improved inte…
Innei Dec 20, 2024
ab773d7
chore: auto-fix linting and formatting issues
Innei Dec 20, 2024
3d4446b
refactor: restructure FeedIcon and enhance list handling in FeedList …
Innei Dec 20, 2024
3d0520d
chore: auto-fix linting and formatting issues
Innei Dec 20, 2024
0575db1
feat: enhance FeedList and ViewTab components with new features and s…
Innei Dec 20, 2024
93e92d2
chore: auto-fix linting and formatting issues
Innei Dec 20, 2024
d67b8f0
feat: apple sign in, not work yet
hyoban Dec 20, 2024
7e4beaa
chore: bring type check lint back
hyoban Dec 20, 2024
53ded0c
feat: enhance mobile app components and linting configuration
Innei Dec 20, 2024
9b34f06
chore: enable no-inline-styles
hyoban Dec 20, 2024
c191ffc
chore: update
hyoban Dec 20, 2024
dca84bb
chore: auto-fix linting and formatting issues
hyoban Dec 20, 2024
ca18cad
feat: enhance feed-list functionality with new components and depende…
Innei Dec 20, 2024
89d35e6
feat: improve ViewTab component with animated tab indicator and dynam…
Innei Dec 20, 2024
ea1b2a7
fix: lockfile
Innei Dec 20, 2024
c252e9d
refactor: video URL transformation
lawvs Dec 20, 2024
cb0ab5f
fix: web dev
lawvs Dec 20, 2024
5f5fd8f
chore: add URL linking functionality to Add screen
lawvs Dec 22, 2024
ca5d54b
chore: expo update config
hyoban Dec 23, 2024
b3f4d29
Merge branch 'dev' into feat/mobile
hyoban Dec 23, 2024
b89eb97
feat: enhance feed-list and configuration with new features and optim…
Innei Dec 23, 2024
6a457b2
chore: auto-fix linting and formatting issues
Innei Dec 23, 2024
c3289ba
feat: integrate gesture handling and state management for feed view
Innei Dec 23, 2024
59e9d65
chore: update prepare script
hyoban Dec 23, 2024
e297e72
chore: prepare for rn web build
hyoban Dec 23, 2024
f59f064
feat: add inbox management and improve list handling in feed view
Innei Dec 23, 2024
dc22c76
chore: auto-fix linting and formatting issues
Innei Dec 23, 2024
90d0aa1
Merge branch 'dev' into feat/mobile
hyoban Dec 23, 2024
37d72f9
feat: enhance mobile app with new context menu and unread management
Innei Dec 23, 2024
e4023d5
feat: integrate context menu and enhance unread management in feed list
Innei Dec 23, 2024
50522ee
feat: enhance feed list with swipeable actions and performance improv…
Innei Dec 23, 2024
810a51c
refactor: proxy creation to use evalCode for improved reusability
lawvs Dec 23, 2024
b50c4c0
refactor: update Add screen to use router for navigation and handle d…
lawvs Dec 23, 2024
eacffce
feat: implement deep linking support and refactor navigation handling…
lawvs Dec 23, 2024
3664e4b
fix: use hash router for rn web
hyoban Dec 24, 2024
4f5a626
chore: fill submit info
hyoban Dec 24, 2024
d20ee1e
chore: autoIncrement version
hyoban Dec 24, 2024
f258821
fix: remove unnecessary width class to prevent unexpected scrolling
lawvs Dec 24, 2024
a18e789
feat: improve login page ui
hyoban Dec 24, 2024
dcc2dfa
fix: disable state
hyoban Dec 24, 2024
a1367ba
refactor: enhance ViewTab layout and header background in FeedList
Innei Dec 24, 2024
665a241
feat: integrate react-native-reanimated and enhance feed list functio…
Innei Dec 24, 2024
d28b9ad
feat: enhance feed list and debug panel functionality
Innei Dec 24, 2024
61ac521
feat: sort
Innei Dec 24, 2024
d78f7ee
feat: enhance ItemPressable and refactor feed list interaction
Innei Dec 24, 2024
15687ff
Merge branch 'dev' into feat/mobile
hyoban Dec 25, 2024
276ae8d
Merge branch 'dev' into feat/mobile
hyoban Dec 25, 2024
f24f42a
fix: padding safe for webview
hyoban Dec 25, 2024
b497830
chore: update FollowWebView background style
lawvs Dec 25, 2024
159cb40
fix: enable hoverOnlyWhenSupported for rn web build
hyoban Dec 25, 2024
c32619c
feat: subscription management ctx menu
Innei Dec 25, 2024
56eef31
Merge branch 'dev' into feat/mobile
hyoban Dec 25, 2024
dcbe3aa
refactor: update API URL handling and enhance subscription management
Innei Dec 25, 2024
b3c1513
Merge branch 'dev' into feat/mobile
hyoban Dec 25, 2024
f86a5dd
feat: user management features and list and category ctx menu
Innei Dec 25, 2024
e515569
feat: enhance Add screen and layout for better user experience
Innei Dec 25, 2024
945e629
style: update input field styling in Add screen for improved dark mod…
Innei Dec 25, 2024
9537bc4
feat: update mobile app configuration and enhance subscription list i…
Innei Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ VITE_BUILD_TYPE=production
VITE_INBOXES_EMAIL=@follow.re
VITE_OPENPANEL_CLIENT_ID=
VITE_OPENPANEL_API_URL=
EXPO_PUBLIC_FOLLOW_LOGIN_URL=
1 change: 1 addition & 0 deletions apps/mobile/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EXPO_PUBLIC_FOLLOW_LOGIN_URL=https://app.follow.is/login
40 changes: 40 additions & 0 deletions apps/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

app-example
ios
android
50 changes: 50 additions & 0 deletions apps/mobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to your Expo app 👋

This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).

## Get started

1. Install dependencies

```bash
npm install
```

2. Start the app

```bash
npx expo start
```

In the output, you'll find options to open the app in a

- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo

You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).

## Get a fresh project

When you're ready, run:

```bash
npm run reset-project
```

This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.

## Learn more

To learn more about developing your project with Expo, look at the following resources:

- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.

## Join the community

Join our community of developers creating universal apps.

- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
62 changes: 62 additions & 0 deletions apps/mobile/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { resolve } from "node:path"

import type { ConfigContext, ExpoConfig } from "expo/config"

const iconPath = resolve(__dirname, "../../resources/icon.png")
export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: "Follow",
slug: "follow",
version: "1.0.0",
orientation: "portrait",
icon: iconPath,
scheme: "follow",
userInterfaceStyle: "automatic",
newArchEnabled: true,
ios: {
supportsTablet: true,
bundleIdentifier: "is.follow.app",
},
android: {
package: "is.follow.app",
adaptiveIcon: {
foregroundImage: iconPath,
backgroundColor: "#ffffff",
},
},
web: {
bundler: "metro",
output: "static",
favicon: iconPath,
},
plugins: [
[
"expo-router",
{
root: "./src/screens",
},
],
[
"expo-splash-screen",
{
image: iconPath,
imageWidth: 200,
resizeMode: "contain",
backgroundColor: "#ffffff",
},
],
"react-native-bottom-tabs",
[
"expo-build-properties",
{
ios: {
useFrameworks: "static",
},
},
],
[require("./scripts/withFollowAssets.js")],
],
experiments: {
typedRoutes: true,
},
})
6 changes: 6 additions & 0 deletions apps/mobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function (api) {
api.cache(true)
return {
presets: [["babel-preset-expo", { jsxImportSource: "nativewind" }], "nativewind/babel"],
}
}
6 changes: 6 additions & 0 deletions apps/mobile/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { getDefaultConfig } = require("expo/metro-config")
const { withNativeWind } = require("nativewind/metro")

const config = getDefaultConfig(__dirname, { isCSSEnabled: true })

module.exports = withNativeWind(config, { input: "./src/global.css" })
3 changes: 3 additions & 0 deletions apps/mobile/nativewind-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="nativewind/types" />

// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind.
60 changes: 60 additions & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@follow/mobile",
"version": "1.0.0",
"private": true,
"main": "expo-router/entry",
"scripts": {
"android": "expo run:android",
"ios": "expo run:ios",
"ios:device": "expo run:ios --device",
"lint": "expo lint",
"start": "expo start",
"start:client": "expo start --dev-client",
"web": "expo start --web"
},
"dependencies": {
"@bottom-tabs/react-navigation": "^0.7.6",
"@expo/vector-icons": "^14.0.2",
"@follow/constants": "workspace:*",
"@react-navigation/bottom-tabs": "^7.0.0",
"@react-navigation/native": "^7.0.0",
"@shopify/flash-list": "1.7.1",
"expo": "52.0.18",
"expo-blur": "~14.0.1",
"expo-build-properties": "^0.13.1",
"expo-constants": "~17.0.3",
"expo-font": "~13.0.1",
"expo-haptics": "~14.0.0",
"expo-linear-gradient": "~14.0.1",
"expo-linking": "~7.0.3",
"expo-router": "4.0.11",
"expo-sharing": "~13.0.0",
"expo-splash-screen": "~0.29.18",
"expo-status-bar": "~2.0.0",
"expo-symbols": "~0.2.0",
"expo-system-ui": "~4.0.6",
"expo-web-browser": "~14.0.1",
"jotai": "2.10.3",
"nativewind": "4.1.23",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-native": "0.76.5",
"react-native-bottom-tabs": "^0.7.6",
"react-native-gesture-handler": "~2.20.2",
"react-native-reanimated": "~3.16.5",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.1.0",
"react-native-svg": "15.8.0",
"react-native-web": "~0.19.13",
"react-native-webview": "13.12.5",
"swiftui-react-native": "6.3.3",
"tailwindcss": "3.4.16",
"zustand": "5.0.2"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "^18.3.12",
"@types/react-test-renderer": "^18.3.0",
"react-test-renderer": "18.3.1"
}
}
95 changes: 95 additions & 0 deletions apps/mobile/scripts/withFollowAssets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* If you add an asset you need to run `npx expo prebuild`
* If you rename or delete an asset you need to run `npx expo prebuild --clean` to delete them in your android and ios folder as well.
*
* This plugin is inspired by the following plugins:
* - [expo-custom-assets](https://github.com/Malaa-tech/expo-custom-assets)
* - [spacedrive](https://github.com/spacedriveapp/spacedrive/blob/main/apps/mobile/scripts/withRiveAssets.js)
*/

const { withDangerousMod, withXcodeProject, IOSConfig } = require("@expo/config-plugins")
const fs = require("node:fs")
const path = require("node:path")

const followRoot = path.resolve(__dirname, "..", "..", "..")

// Specify the source directory of your assets
const ASSET_SOURCE_DIR = path.join("out", "web")

const IOS_GROUP_NAME = "Assets"

const withFollowAssets = (config) => {
config = addAndroidResources(config)
config = addIOSResources(config)
return config
}

// Code inspired by https://github.com/rive-app/rive-react-native/issues/185#issuecomment-1593396573
function addAndroidResources(config) {
return withDangerousMod(config, [
"android",
async (config) => {
// Get the path to the Android project directory
const { projectRoot } = config.modRequest

// Get the path to the Android resources directory
const resDir = path.join(projectRoot, "android", "app", "src", "main", "res")

// Create the 'raw' directory if it doesn't exist
const rawDir = path.join(resDir, "raw")
fs.mkdirSync(rawDir, { recursive: true })

// Get the path to the assets directory
const assetSourcePath = path.join(followRoot, ASSET_SOURCE_DIR)

// Retrieve all files in the assets directory
// const assetFiles = fs.readdirSync(assetSourcePath)

// Move asset file to the resources 'raw' directory
fs.cpSync(assetSourcePath, rawDir, { recursive: true })

// Move each asset file to the resources 'raw' directory
// for (const assetFile of assetFiles) {
// const srcAssetPath = path.join(assetSourcePath, assetFile)
// const destAssetPath = path.join(rawDir, assetFile)
// fs.copyFileSync(srcAssetPath, destAssetPath)
// }

return config
},
])
}

// Code inspired by https://github.com/expo/expo/blob/61f8cf8d4b3cf5f8bf61f346476ebdb4aff40545/packages/expo-font/plugin/src/withFontsIos.ts
function addIOSResources(config) {
return withXcodeProject(config, async (config) => {
const project = config.modResults
const { platformProjectRoot } = config.modRequest

// Create Assets group in project
IOSConfig.XcodeUtils.ensureGroupRecursively(project, IOS_GROUP_NAME)

// Get filepaths
const assetSourcePath = path.resolve(followRoot, ASSET_SOURCE_DIR)

// Add assets to group
addIOSResourceFile(project, platformProjectRoot, [assetSourcePath])

return config
})

function addIOSResourceFile(project, platformRoot, assetFilesPaths) {
for (const assetFile of assetFilesPaths) {
const riveFilePath = path.relative(platformRoot, assetFile)
IOSConfig.XcodeUtils.addResourceFileToGroup({
filepath: riveFilePath,
groupName: IOS_GROUP_NAME,
project,
isBuildFile: true,
verbose: true,
})
}
}
}

module.exports = withFollowAssets
8 changes: 8 additions & 0 deletions apps/mobile/shim-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="nativewind/types" />

declare namespace NodeJS {
export interface ProcessEnv {
EXPO_PUBLIC_FOLLOW_LOGIN_URL: string
[key: string]: string | undefined
}
}
4 changes: 4 additions & 0 deletions apps/mobile/src/components/common/BottomTabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createNativeBottomTabNavigator } from "@bottom-tabs/react-navigation"
import { withLayoutContext } from "expo-router"

export const Tabs = withLayoutContext(createNativeBottomTabNavigator().Navigator)
40 changes: 40 additions & 0 deletions apps/mobile/src/components/common/FollowWebView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useLocalSearchParams } from "expo-router"
import { Platform } from "react-native"
import type { WebViewProps } from "react-native-webview"
import { WebView } from "react-native-webview"

const isAndroid = Platform.OS === "android"
const presetUri = isAndroid ? "file:///android_asset/raw/index.html" : "web/index.html"
const fallbackUri = "https://app.follow.is"

export const FollowWebView = ({
webViewRef,
...props
}: { webViewRef: React.RefObject<WebView> } & WebViewProps) => {
const searchParams = useLocalSearchParams()

// const [progress, setProgress] = useState(0)

return (
<WebView
ref={webViewRef}
source={{ uri: presetUri ?? fallbackUri }}
injectedJavaScriptBeforeContentLoaded={`
document.cookie="better-auth.session_token=${searchParams.token};domain=.follow.is;path=/";
`}
originWhitelist={["*"]}
allowUniversalAccessFromFileURLs
startInLoadingState
allowsBackForwardNavigationGestures
/* Open chrome://inspect/#devices , or Development menu on Safari to debug the WebView. https://github.com/react-native-webview/react-native-webview/blob/master/docs/Debugging.md#debugging-webview-contents */
webviewDebuggingEnabled
containerStyle={{ width: "100%" }}
// onLoadProgress={({ nativeEvent }) => setProgress(nativeEvent.progress)}
onError={(e) => {
console.error("WebView error:", e)
}}
onContentProcessDidTerminate={() => webViewRef.current?.reload()}
{...props}
/>
)
}
Loading
Loading