Skip to content

Commit ba298e5

Browse files
Example app enhancements and bug fixes (#118)
Example app enhancements and bug fixes
2 parents ac03ad5 + 4f26171 commit ba298e5

File tree

23 files changed

+457
-79
lines changed

23 files changed

+457
-79
lines changed

example/android/app/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,6 @@ android {
224224
keyAlias 'androiddebugkey'
225225
keyPassword 'android'
226226
}
227-
release {
228-
storeFile file('adaptui-rn.keystore')
229-
storePassword System.console().readLine("\nKeystore password:")
230-
keyAlias 'your_key_alias'
231-
keyPassword 'your_key_file_alias_password'
232-
}
233227
}
234228
buildTypes {
235229
debug {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources>
2+
<color name="splashscreen_background">#ffffff</color>
3+
<color name="iconBackground">#FFFFFF</color>
24
<color name="colorPrimary">#023c69</color>
35
<color name="colorPrimaryDark">#ffffff</color>
4-
<color name="iconBackground">#FFFFFF</color>
5-
<color name="splashscreen_background">#ffffff</color>
66
</resources>

example/assets/logo.png

1.26 MB
Loading

example/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
import { createElement } from "react";
2+
import { createRoot } from "react-dom/client";
3+
import { Platform } from "react-native";
14
import { registerRootComponent } from "expo";
25

36
import App from "./src/App";
47

58
import "react-native-gesture-handler";
9+
610
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
711
// It also ensures that whether you load the app in the Expo client or in a native build,
812
// the environment is set up appropriately
9-
registerRootComponent(App);
13+
if (Platform.OS === "web") {
14+
const rootTag = createRoot(
15+
document.getElementById("root") ?? document.getElementById("main"),
16+
);
17+
rootTag.render(createElement(App));
18+
} else {
19+
registerRootComponent(App);
20+
}

example/ios/AdaptUIReactNative.xcodeproj/project.pbxproj

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
1111
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1212
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
13+
300C165DCD54494CBC9BD068 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2BF492B9FA244799D642BBF /* noop-file.swift */; };
1314
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
14-
7B697CDF00F3471688541D46 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72F1F55DBF1B495D92C207CC /* noop-file.swift */; };
1515
96905EF65AED1B983A6B3ABC /* libPods-AdaptUIReactNative.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-AdaptUIReactNative.a */; };
1616
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
1717
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
@@ -27,9 +27,9 @@
2727
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = AdaptUIReactNative/main.m; sourceTree = "<group>"; };
2828
58EEBF8E8E6FB1BC6CAF49B5 /* libPods-AdaptUIReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AdaptUIReactNative.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2929
6C2E3173556A471DD304B334 /* Pods-AdaptUIReactNative.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdaptUIReactNative.debug.xcconfig"; path = "Target Support Files/Pods-AdaptUIReactNative/Pods-AdaptUIReactNative.debug.xcconfig"; sourceTree = "<group>"; };
30-
72F1F55DBF1B495D92C207CC /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "AdaptUIReactNative/noop-file.swift"; sourceTree = "<group>"; };
3130
7A4D352CD337FB3A3BF06240 /* Pods-AdaptUIReactNative.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdaptUIReactNative.release.xcconfig"; path = "Target Support Files/Pods-AdaptUIReactNative/Pods-AdaptUIReactNative.release.xcconfig"; sourceTree = "<group>"; };
3231
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = AdaptUIReactNative/SplashScreen.storyboard; sourceTree = "<group>"; };
32+
B2BF492B9FA244799D642BBF /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "AdaptUIReactNative/noop-file.swift"; sourceTree = "<group>"; };
3333
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
3434
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
3535
FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-AdaptUIReactNative/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
@@ -58,7 +58,7 @@
5858
13B07FB61A68108700A75B9A /* Info.plist */,
5959
13B07FB71A68108700A75B9A /* main.m */,
6060
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
61-
72F1F55DBF1B495D92C207CC /* noop-file.swift */,
61+
B2BF492B9FA244799D642BBF /* noop-file.swift */,
6262
);
6363
name = AdaptUIReactNative;
6464
sourceTree = "<group>";
@@ -150,7 +150,7 @@
150150
13B07F8E1A680F5B00A75B9A /* Resources */,
151151
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
152152
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */,
153-
7E436276BADA555A32E7C530 /* [CP] Embed Pods Frameworks */,
153+
553DD0AB30D2A058FADBC9A4 /* [CP] Embed Pods Frameworks */,
154154
);
155155
buildRules = (
156156
);
@@ -170,7 +170,6 @@
170170
LastUpgradeCheck = 1130;
171171
TargetAttributes = {
172172
13B07F861A680F5B00A75B9A = {
173-
DevelopmentTeam = 6GZGJRTV33;
174173
LastSwiftMigration = 1250;
175174
};
176175
};
@@ -243,7 +242,7 @@
243242
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
244243
showEnvVarsInLog = 0;
245244
};
246-
7E436276BADA555A32E7C530 /* [CP] Embed Pods Frameworks */ = {
245+
553DD0AB30D2A058FADBC9A4 /* [CP] Embed Pods Frameworks */ = {
247246
isa = PBXShellScriptBuildPhase;
248247
buildActionMask = 2147483647;
249248
files = (
@@ -310,7 +309,7 @@
310309
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
311310
13B07FC11A68108700A75B9A /* main.m in Sources */,
312311
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */,
313-
7B697CDF00F3471688541D46 /* noop-file.swift in Sources */,
312+
300C165DCD54494CBC9BD068 /* noop-file.swift in Sources */,
314313
);
315314
runOnlyForDeploymentPostprocessing = 0;
316315
};
@@ -325,7 +324,6 @@
325324
CLANG_ENABLE_MODULES = YES;
326325
CODE_SIGN_ENTITLEMENTS = AdaptUIReactNative/AdaptUIReactNative.entitlements;
327326
CURRENT_PROJECT_VERSION = 1;
328-
DEVELOPMENT_TEAM = 6GZGJRTV33;
329327
ENABLE_BITCODE = NO;
330328
GCC_PREPROCESSOR_DEFINITIONS = (
331329
"$(inherited)",
@@ -357,7 +355,6 @@
357355
CLANG_ENABLE_MODULES = YES;
358356
CODE_SIGN_ENTITLEMENTS = AdaptUIReactNative/AdaptUIReactNative.entitlements;
359357
CURRENT_PROJECT_VERSION = 1;
360-
DEVELOPMENT_TEAM = 6GZGJRTV33;
361358
INFOPLIST_FILE = AdaptUIReactNative/Info.plist;
362359
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
363360
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

example/ios/AdaptUIReactNative.xcodeproj/xcshareddata/xcschemes/AdaptUIReactNative.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</Testables>
4242
</TestAction>
4343
<LaunchAction
44-
buildConfiguration = "Release"
44+
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4747
launchStyle = "0"

example/ios/AdaptUIReactNative.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

Lines changed: 0 additions & 8 deletions
This file was deleted.

example/ios/Podfile.lock

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PODS:
1111
- ExpoModulesCore
1212
- Expo (47.0.8):
1313
- ExpoModulesCore
14+
- ExpoHaptics (12.0.1):
15+
- ExpoModulesCore
1416
- ExpoKeepAwake (11.0.1):
1517
- ExpoModulesCore
1618
- ExpoModulesCore (1.0.3):
@@ -332,6 +334,8 @@ PODS:
332334
- React-jsi (= 0.70.5)
333335
- React-logger (= 0.70.5)
334336
- React-perflogger (= 0.70.5)
337+
- RNCMaskedView (0.2.8):
338+
- React-Core
335339
- RNGestureHandler (2.8.0):
336340
- React-Core
337341
- RNReanimated (2.12.0):
@@ -376,6 +380,7 @@ DEPENDENCIES:
376380
- EXFileSystem (from `../node_modules/expo-file-system/ios`)
377381
- EXFont (from `../node_modules/expo-font/ios`)
378382
- Expo (from `../node_modules/expo`)
383+
- ExpoHaptics (from `../node_modules/expo-haptics/ios`)
379384
- ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`)
380385
- ExpoModulesCore (from `../node_modules/expo-modules-core`)
381386
- EXScreenOrientation (from `../node_modules/expo-screen-orientation/ios`)
@@ -414,6 +419,7 @@ DEPENDENCIES:
414419
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
415420
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
416421
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
422+
- "RNCMaskedView (from `../node_modules/@react-native-masked-view/masked-view`)"
417423
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
418424
- RNReanimated (from `../node_modules/react-native-reanimated`)
419425
- RNScreens (from `../node_modules/react-native-screens`)
@@ -440,6 +446,8 @@ EXTERNAL SOURCES:
440446
:path: "../node_modules/expo-font/ios"
441447
Expo:
442448
:path: "../node_modules/expo"
449+
ExpoHaptics:
450+
:path: "../node_modules/expo-haptics/ios"
443451
ExpoKeepAwake:
444452
:path: "../node_modules/expo-keep-awake/ios"
445453
ExpoModulesCore:
@@ -512,6 +520,8 @@ EXTERNAL SOURCES:
512520
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
513521
ReactCommon:
514522
:path: "../node_modules/react-native/ReactCommon"
523+
RNCMaskedView:
524+
:path: "../node_modules/@react-native-masked-view/masked-view"
515525
RNGestureHandler:
516526
:path: "../node_modules/react-native-gesture-handler"
517527
RNReanimated:
@@ -531,17 +541,18 @@ SPEC CHECKSUMS:
531541
EXFileSystem: 60602b6eefa6873f97172c684b7537c9760b50d6
532542
EXFont: 319606bfe48c33b5b5063fb0994afdc496befe80
533543
Expo: 36b5f625d36728adbdd1934d4d57182f319ab832
544+
ExpoHaptics: 5a56d30a87ea213dd00b09566dc4b441a4dff97f
534545
ExpoKeepAwake: 69b59d0a8d2b24de9f82759c39b3821fec030318
535546
ExpoModulesCore: b5d21c8880afda6fb6ee95469f9ac2ec9b98e995
536547
EXScreenOrientation: 07e5aeff07bce09a2b214981e612d87fd7719997
537548
EXSplashScreen: 3e989924f61a8dd07ee4ea584c6ba14be9b51949
538549
FBLazyVector: affa4ba1bfdaac110a789192f4d452b053a86624
539550
FBReactNativeSpec: fe8b5f1429cfe83a8d72dc8ed61dc7704cac8745
540551
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
541-
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
542-
hermes-engine: 7fe5fc6ef707b7fdcb161b63898ec500e285653d
552+
glog: 791fe035093b84822da7f0870421a25839ca7870
553+
hermes-engine: 31d2d06aa6915f586c02ecadbe232e3fc8185878
543554
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
544-
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
555+
RCT-Folly: 766adb69dc1d6294bcc94a950a818a87adb3a766
545556
RCTRequired: 21229f84411088e5d8538f21212de49e46cc83e2
546557
RCTTypeSafety: 62eed57a32924b09edaaf170a548d1fc96223086
547558
React: f0254ccddeeef1defe66c6b1bb9133a4f040792b
@@ -569,6 +580,7 @@ SPEC CHECKSUMS:
569580
React-RCTVibration: 8e5c8c5d17af641f306d7380d8d0fe9b3c142c48
570581
React-runtimeexecutor: 7401c4a40f8728fd89df4a56104541b760876117
571582
ReactCommon: c9246996e73bf75a2c6c3ff15f1e16707cdc2da9
583+
RNCMaskedView: bc0170f389056201c82a55e242e5d90070e18e5a
572584
RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3
573585
RNReanimated: 2a91e85fcd343f8af3c58d3425b99fdd285590a5
574586
RNScreens: 34cc502acf1b916c582c60003dc3089fa01dc66d

example/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
"start": "expo start --dev-client"
1212
},
1313
"dependencies": {
14-
"@react-navigation/drawer": "^6.5.3",
14+
"@react-native-masked-view/masked-view": "0.2.8",
15+
"@react-navigation/drawer": "^6.5.7",
1516
"@react-navigation/native": "^6.0.16",
17+
"@react-navigation/stack": "^6.3.11",
1618
"expo": "^47.0.0",
1719
"expo-haptics": "~12.0.1",
1820
"expo-screen-orientation": "^5.0.1",

example/src/AppRoot.tsx

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import React, { ReactNode } from "react";
2+
import {
3+
Box,
4+
Button,
5+
Divider,
6+
Icon,
7+
Text,
8+
Timeless,
9+
useTheme,
10+
} from "@adaptui/react-native-tailwind";
211
import {
312
createDrawerNavigator,
413
DrawerContentComponentProps,
514
DrawerContentScrollView,
615
DrawerItem,
716
} from "@react-navigation/drawer";
17+
import { createStackNavigator } from "@react-navigation/stack";
818

9-
import { Divider } from "../../src/components";
10-
import { Box, Text } from "../../src/primitives";
11-
import { useTheme } from "../../src/theme";
12-
19+
import AboutScreen from "./pages/AboutScreen";
1320
import {
1421
AvatarGroupScreen,
1522
AvatarScreen,
@@ -32,6 +39,8 @@ import {
3239
TooltipScreen,
3340
} from "./modules";
3441

42+
const Stack = createStackNavigator();
43+
3544
const Drawer = createDrawerNavigator();
3645

3746
const CustomDrawerSection = (props: DrawerContentComponentProps) => {
@@ -88,15 +97,34 @@ const CustomDrawerSection = (props: DrawerContentComponentProps) => {
8897
</Box>
8998
);
9099
})}
100+
<Box style={tailwind.style("h-8 w-full")} />
91101
</DrawerContentScrollView>
92102
);
93103
};
94104

95-
const AppRoot = () => {
105+
const ScreenOptions = ({ navigation }) => {
106+
const tailwind = useTheme();
107+
return {
108+
headerRight: () => (
109+
<Box style={tailwind.style("mr-2")}>
110+
<Button
111+
variant="ghost"
112+
size="md"
113+
onPress={() => navigation.navigate("About")}
114+
>
115+
<Icon size={25} icon={<Timeless />} />
116+
</Button>
117+
</Box>
118+
),
119+
};
120+
};
121+
122+
const DrawerNavigator = () => {
96123
return (
97124
<Drawer.Navigator
98125
drawerContent={CustomDrawerSection}
99126
initialRouteName="AvatarScreen"
127+
screenOptions={ScreenOptions}
100128
>
101129
<Drawer.Screen
102130
// @ts-ignore
@@ -209,7 +237,6 @@ const AppRoot = () => {
209237
name="ProgressScreen"
210238
component={ProgressScreen}
211239
/>
212-
213240
<Drawer.Screen
214241
// @ts-ignore
215242
options={{ title: "Tooltip", groupName: "POPUPS" }}
@@ -220,4 +247,21 @@ const AppRoot = () => {
220247
);
221248
};
222249

250+
const AppRoot = () => {
251+
return (
252+
<Stack.Navigator initialRouteName="About">
253+
<Stack.Screen
254+
name="About"
255+
component={AboutScreen}
256+
options={{ headerShown: false }}
257+
/>
258+
<Stack.Screen
259+
name="Components"
260+
component={DrawerNavigator}
261+
options={{ headerShown: false }}
262+
/>
263+
</Stack.Navigator>
264+
);
265+
};
266+
223267
export default AppRoot;

0 commit comments

Comments
 (0)