Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
heintayzar-hm committed May 25, 2023
1 parent 955af20 commit aec0ea4
Show file tree
Hide file tree
Showing 20 changed files with 5,212 additions and 423 deletions.
8 changes: 8 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.
> What do the files contain?
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
- "settings.json": contains the server configuration that is used to serve the application manifest.
> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
3 changes: 3 additions & 0 deletions .expo/devices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"devices": []
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.currencyforyou;
import expo.modules.ReactActivityDelegateWrapper;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
Expand All @@ -23,13 +24,13 @@ protected String getMainComponentName() {
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new DefaultReactActivityDelegate(
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
);
));
}
}
14 changes: 12 additions & 2 deletions android/app/src/main/java/com/currencyforyou/MainApplication.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package com.currencyforyou;
import android.content.res.Configuration;
import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;

import android.app.Application;
import com.facebook.react.PackageList;
Expand All @@ -13,7 +16,7 @@
public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost =
new DefaultReactNativeHost(this) {
new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
Expand Down Expand Up @@ -42,7 +45,7 @@ protected boolean isNewArchEnabled() {
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
};
});

@Override
public ReactNativeHost getReactNativeHost() {
Expand All @@ -58,5 +61,12 @@ public void onCreate() {
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.android.tools.build:gradle:7.4.1")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
5 changes: 5 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ rootProject.name = 'CurrencyForYou'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
6 changes: 3 additions & 3 deletions components/CurrenciesList/renderCurrency.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const renderCurrency = ({item, currentCurrency, onCurrencyClick, currencies}) =>
<TouchableOpacity onPress={() => onCurrencyClick(item)} id='item' key={item}>
{
item === currentCurrency ? (
<View style={styles.currencyContainer} key={item}>
<Text style={styles.currencyCode}>{item}</Text>
<View style={styles.currencyBold} key={item}>
<Text style={styles.currencyCodeBoldText}>{item}</Text>
<Text> - </Text>
<Text style={styles.currencyName}>{currencies[item]}</Text>
<Text style={styles.currencyNameBoldText}>{currencies[item]}</Text>
<Icon name="pin" size={30} color="blue" />
</View>
)
Expand Down
23 changes: 23 additions & 0 deletions components/CurrenciesList/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,27 @@ export default StyleSheet.create({
borderWidth: 1,
paddingHorizontal: 10,
},
currencyBold: {
flexDirection: "row",
alignItems: "center",
padding: 10,
backgroundColor: "rgb(174 255 248)",
},
currencyBoldText: {
fontWeight: "bold",
backgroundColor: "rgb(174 255 248)",
color: "black",
},
currencyCodeBoldText: {
marginRight: 10,
fontWeight: "bold",
backgroundColor: "rgb(174 255 248)",
color: "black",
},
currencyNameBoldText: {
flex: 1,
fontWeight: "bold",
backgroundColor: "rgb(174 255 248)",
color: "black",
},
});
6 changes: 3 additions & 3 deletions components/ExchangeList/renderCurrency.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const renderCurrency = ({item, currentCurrency, currencies }) => (
<View key={item} style={{ flex:1 }}>
{
item === currentCurrency ? (
<View style={styles.currencyContainer} key={item}>
<Text style={styles.currencyCode}>{item}</Text>
<View style={styles.currencyBold} key={item}>
<Text style={styles.currencyCodeBoldText}>{item}</Text>
<Text> - </Text>
<Text style={styles.currencyName}>{currencies[item]}</Text>
<Text style={styles.currencyNameBoldText}>{currencies[item]}</Text>
<Icon name="pin" size={30} color="blue" />
</View>
)
Expand Down
23 changes: 23 additions & 0 deletions components/ExchangeList/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,27 @@ export default StyleSheet.create({
borderWidth: 1,
paddingHorizontal: 10,
},
currencyBold: {
flexDirection: "row",
alignItems: "center",
padding: 10,
backgroundColor: "rgb(174 255 248)",
},
currencyBoldText: {
fontWeight: "bold",
backgroundColor: "rgb(174 255 248)",
color: "black",
},
currencyCodeBoldText: {
marginRight: 10,
fontWeight: "bold",
backgroundColor: "rgb(174 255 248)",
color: "black",
},
currencyNameBoldText: {
flex: 1,
fontWeight: "bold",
backgroundColor: "rgb(174 255 248)",
color: "black",
},
});
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

import {AppRegistry} from "react-native";
import App from "./App";
import {name as appName} from "./app.json";
// import {name as appName} from "./app.json";

AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent("main", () => App);
20 changes: 10 additions & 10 deletions ios/CurrencyForYou.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* Begin PBXContainerItemProxy section */
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
containerPortal = 83CBB9F71A601CBA00E9B192;
proxyType = 1;
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = CurrencyForYou;
Expand Down Expand Up @@ -113,7 +113,7 @@
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
83CBB9F61A601CBA00E9B192 /* PBXGroup */ = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* CurrencyForYou */,
Expand Down Expand Up @@ -197,14 +197,14 @@
/* End PBXNativeTarget section */

/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 /* Project object */ = {
83CBB9F71A601CBA00E9B192 = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1210;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
TestTargetID = 13B07F861A680F5B00A75B9A /* CurrencyForYou */;
};
13B07F861A680F5B00A75B9A = {
LastSwiftMigration = 1120;
Expand All @@ -219,7 +219,7 @@
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
mainGroup = 83CBB9F61A601CBA00E9B192 /* PBXGroup */;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -438,7 +438,7 @@
"$(inherited)",
);
INFOPLIST_FILE = CurrencyForYouTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -462,7 +462,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = CurrencyForYouTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -580,7 +580,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -644,7 +644,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -698,5 +698,5 @@
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
rootObject = 83CBB9F71A601CBA00E9B192;
}
3 changes: 2 additions & 1 deletion ios/CurrencyForYou/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#import <RCTAppDelegate.h>
#import <Expo/Expo.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : RCTAppDelegate
@interface AppDelegate : EXAppDelegateWrapper

@end
26 changes: 25 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
platform :ios, '13.0'
prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
Expand All @@ -22,6 +23,29 @@ if linkage != nil
end

target 'CurrencyForYou' do
use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
config = use_native_modules!

# Flags change depending on the env values.
Expand Down
Loading

0 comments on commit aec0ea4

Please sign in to comment.