Skip to content

Commit 040c59a

Browse files
authored
Merge pull request #531 from mozzius/samuel/bottom-tabs
Native bottom tabs
2 parents 2bd301a + bd4c323 commit 040c59a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1665
-1316
lines changed

apps/expo/app.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,22 @@ const defineConfig = (_: ConfigContext): ExpoConfig => ({
7272
typedRoutes: false, // too much string interpolation :(
7373
},
7474
plugins: [
75+
"./plugins/withStaticPods.js",
76+
[
77+
"react-native-edge-to-edge",
78+
{
79+
android: {
80+
parentTheme: "Material3",
81+
},
82+
},
83+
],
7584
[
7685
"expo-build-properties",
7786
{
7887
ios: {
7988
deploymentTarget: "14.0",
89+
useFrameworks: "static",
90+
ccacheEnabled: true,
8091
},
8192
},
8293
],

apps/expo/assets/tabs/bell.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/expo/assets/tabs/cloud.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/expo/assets/tabs/cloudy.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/expo/assets/tabs/search.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/expo/assets/tabs/square-pen.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/expo/assets/tabs/user.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/expo/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graysky/app",
3-
"version": "1.6.4",
3+
"version": "1.7.0",
44
"main": "index.tsx",
55
"scripts": {
66
"eas-build-pre-install": "./scripts/pre-install.sh",
@@ -28,6 +28,7 @@
2828
},
2929
"dependencies": {
3030
"@atproto/api": "^0.13.31",
31+
"@bottom-tabs/react-navigation": "^0.8.6",
3132
"@expo/metro-config": "^0.18.11",
3233
"@expo/react-native-action-sheet": "^4.0.1",
3334
"@formatjs/intl-getcanonicallocales": "^2.3.0",
@@ -79,7 +80,6 @@
7980
"expo-screen-orientation": "^7.0.5",
8081
"expo-sharing": "^12.0.1",
8182
"expo-splash-screen": "~0.27.5",
82-
"expo-status-bar": "~1.12.1",
8383
"expo-system-ui": "~3.0.7",
8484
"expo-task-manager": "^11.7.2",
8585
"expo-updates": "^0.25.24",
@@ -99,11 +99,13 @@
9999
"react-native": "0.75.3",
100100
"react-native-avoid-softinput": "^5.0.0",
101101
"react-native-awesome-gallery": "^0.4.2",
102+
"react-native-bottom-tabs": "^0.8.6",
102103
"react-native-circular-progress": "^1.3.9",
103104
"react-native-collapsible-tab-view": "^8.0.0",
104-
"react-native-date-picker": "^5.0.0",
105+
"react-native-date-picker": "^5.0.10",
105106
"react-native-draggable-flatlist": "^4.0.1",
106107
"react-native-drawer-layout": "4.0.0-alpha.5",
108+
"react-native-edge-to-edge": "^1.4.3",
107109
"react-native-gesture-handler": "~2.19.0",
108110
"react-native-image-crop-picker": "0.41.2",
109111
"react-native-ios-context-menu": "^3.1.0",

apps/expo/plugins/withStaticPods.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
const { promises: fs } = require("node:fs");
2+
const path = require("node:path");
3+
const {
4+
withDangerousMod,
5+
} = require("@expo/config-plugins/build/plugins/withDangerousMod.js");
6+
const {
7+
mergeContents,
8+
} = require("@expo/config-plugins/build/utils/generateCode.js");
9+
10+
function addPreInstall(src) {
11+
return mergeContents({
12+
tag: "add-pre-install",
13+
src,
14+
newSrc: `
15+
pre_install do |installer|
16+
installer.pod_targets.each do |pod|
17+
if pod.name.eql?('react-native-paste-input')
18+
def pod.build_type
19+
Pod::BuildType.static_library
20+
end
21+
end
22+
end
23+
end`,
24+
anchor: /use_expo_modules!/,
25+
offset: 1,
26+
comment: "#",
27+
});
28+
}
29+
30+
const withPreInstall = (config) => {
31+
return withDangerousMod(config, [
32+
"ios",
33+
async (config) => {
34+
const filePath = path.join(
35+
config.modRequest.platformProjectRoot,
36+
"Podfile",
37+
);
38+
const contents = await fs.readFile(filePath, "utf-8");
39+
let results;
40+
if (contents.indexOf("pod.name.eql?('react-native-paste-input')") > -1) {
41+
return config;
42+
} else {
43+
try {
44+
results = addPreInstall(contents);
45+
} catch (error) {
46+
if (error.code === "ERR_NO_MATCH") {
47+
throw new Error(
48+
`Cannot add pre_install hook to project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.`,
49+
);
50+
}
51+
throw error;
52+
}
53+
54+
if (results.didMerge || results.didClear) {
55+
await fs.writeFile(filePath, results.contents);
56+
}
57+
return config;
58+
}
59+
},
60+
]);
61+
};
62+
63+
const initPlugin = (config) => {
64+
config = withPreInstall(config);
65+
return config;
66+
};
67+
68+
module.exports = initPlugin;

apps/expo/src/app/(auth)/_layout.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ export default function AuthLayout() {
3535
<Stack
3636
screenOptions={{
3737
headerLeft,
38-
...Platform.select({
39-
android: {
40-
animation: "ios",
41-
},
42-
}),
4338
}}
4439
>
4540
<Stack.Screen

0 commit comments

Comments
 (0)