Skip to content

Commit

Permalink
Update Example ⚗️
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesMangwa committed Feb 13, 2021
1 parent accaca9 commit 480d085
Show file tree
Hide file tree
Showing 16 changed files with 2,895 additions and 1,857 deletions.
5 changes: 3 additions & 2 deletions Example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.android.build.OutputFile
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
Expand Down Expand Up @@ -157,7 +157,7 @@ android {
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
Expand Down Expand Up @@ -200,6 +200,7 @@ dependencies {

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
Expand Down
8 changes: 4 additions & 4 deletions Example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

buildscript {
ext {
buildToolsVersion = "28.0.3"
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
compileSdkVersion = 29
targetSdkVersion = 29
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.2")
classpath("com.android.tools.build:gradle:3.5.3")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion Example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ android.useAndroidX=true
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.33.1
FLIPPER_VERSION=0.54.0
Binary file modified Example/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion Example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 12 additions & 17 deletions Example/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
3 changes: 3 additions & 0 deletions Example/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand Down
14 changes: 6 additions & 8 deletions Example/components/DemoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ const HOOKS_MODALS_COLOR: ModalsColorType = [
{ name: 'ModalC', color: 'deeppink' },
]

const DemoModal: ModalComponentWithOptions<ModalComponentProp<
ModalStackParamsList,
void,
ModalName
>> = ({
const DemoModal: ModalComponentWithOptions<
ModalComponentProp<ModalStackParamsList, void, ModalName>
> = ({
modal: { closeModal, closeModals, closeAllModals, openModal, getParam },
}) => {
const [otherModals, setOtherModals] = React.useState<OtherModalsType>([])
Expand Down Expand Up @@ -95,9 +93,9 @@ const DemoModal: ModalComponentWithOptions<ModalComponentProp<

React.useEffect(() => {
setOtherModals(
HOOKS_MODALS_COLOR.filter((entry) => entry.name !== modalName).reduce<
OtherModalsType
>(
HOOKS_MODALS_COLOR.filter(
(entry) => entry.name !== modalName,
).reduce<OtherModalsType>(
(output, item) => [
...output,
{ modalName: item.name, color: item.color },
Expand Down
55 changes: 47 additions & 8 deletions Example/ios/Modalfy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
00E356F31AD99517003FC87E /* ModalfyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ModalfyTests.m */; };
0CAC4A3724374DBB7D21CD2E /* libPods-Modalfy-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F5C20E38BE99419AB0F02A7 /* libPods-Modalfy-tvOSTests.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2DCD954D1E0B4F2C00145EB5 /* ModalfyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ModalfyTests.m */; };
314546A241A6D4FD1E99D92F /* libPods-Modalfy-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DA188EE9BBA22B8E753D6A8 /* libPods-Modalfy-tvOS.a */; };
56C39DCA25D7C49C00B081F8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 56C39DC825D7C49B00B081F8 /* LaunchScreen.storyboard */; };
56C39DCB25D7C49C00B081F8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 56C39DC825D7C49B00B081F8 /* LaunchScreen.storyboard */; };
650998B409DFE0F681B3A6F0 /* libPods-Modalfy.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 03EA2FC65C1BCADF9EEC849A /* libPods-Modalfy.a */; };
C6E4FEC6129986CB17EE2D6A /* libPods-Modalfy-ModalfyTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3013F4F4204D38F063892235 /* libPods-Modalfy-ModalfyTests.a */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -49,13 +50,13 @@
13B07F961A680F5B00A75B9A /* Modalfy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Modalfy.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Modalfy/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Modalfy/AppDelegate.m; sourceTree = "<group>"; };
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Modalfy/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Modalfy/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Modalfy/main.m; sourceTree = "<group>"; };
2D02E47B1E0B4A5D006451C7 /* Modalfy-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Modalfy-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* Modalfy-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Modalfy-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
3013F4F4204D38F063892235 /* libPods-Modalfy-ModalfyTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Modalfy-ModalfyTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
56C39DC925D7C49B00B081F8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Modalfy/Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
7F5C20E38BE99419AB0F02A7 /* libPods-Modalfy-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Modalfy-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9DA188EE9BBA22B8E753D6A8 /* libPods-Modalfy-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Modalfy-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B1F9D6A0CE9536344B722B23 /* Pods-Modalfy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Modalfy.debug.xcconfig"; path = "Target Support Files/Pods-Modalfy/Pods-Modalfy.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -130,7 +131,7 @@
13B07FB01A68108700A75B9A /* AppDelegate.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
56C39DC825D7C49B00B081F8 /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
);
name = Modalfy;
Expand Down Expand Up @@ -208,6 +209,7 @@
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
90CBC12CFCBBC37246E443C9 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -229,6 +231,7 @@
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
AF266559D3A76515088532E5 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -338,8 +341,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
56C39DCA25D7C49C00B081F8 /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -348,6 +351,7 @@
buildActionMask = 2147483647;
files = (
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
56C39DCB25D7C49C00B081F8 /* LaunchScreen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -455,6 +459,42 @@
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";
showEnvVarsInLog = 0;
};
90CBC12CFCBBC37246E443C9 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Modalfy-ModalfyTests/Pods-Modalfy-ModalfyTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Modalfy-ModalfyTests/Pods-Modalfy-ModalfyTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
AF266559D3A76515088532E5 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Modalfy/Pods-Modalfy-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Modalfy/Pods-Modalfy-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -568,13 +608,12 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
56C39DC825D7C49B00B081F8 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
13B07FB21A68108700A75B9A /* Base */,
56C39DC925D7C49B00B081F8 /* Base */,
);
name = LaunchScreen.xib;
path = Modalfy;
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
Expand Down
4 changes: 2 additions & 2 deletions Example/ios/Modalfy/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#if DEBUG
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
Expand All @@ -27,7 +27,7 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
#ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
#endif

Expand Down

0 comments on commit 480d085

Please sign in to comment.