Skip to content

Commit

Permalink
Fixes for iPhoneX, update iOS projec, fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
haikov committed Aug 16, 2018
1 parent 476a570 commit 60ec5c7
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 73 deletions.
Binary file added assets/icons/logo-splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/logo-splash@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/logo-splash@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions ios/quotes.xcodeproj/project.pbxproj
Expand Up @@ -43,13 +43,10 @@
7BD3DA47231A6462492DCEEC /* libPods-quotes-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 99FDF8DA57380568B8AFE9F0 /* libPods-quotes-tvOS.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
8CAE2285140B633D9FFDAEFD /* libPods-quotesTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C5402227225D0DE9620C1F36 /* libPods-quotesTests.a */; };
A949DDEF2112DB8500310AA5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A949DDC92112DB8500310AA5 /* GoogleService-Info.plist */; };
A949DDF02112DB8500310AA5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A949DDC92112DB8500310AA5 /* GoogleService-Info.plist */; };
A949DDF12112DB8500310AA5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A949DDC92112DB8500310AA5 /* GoogleService-Info.plist */; };
A949DDF22112DB8500310AA5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A949DDC92112DB8500310AA5 /* GoogleService-Info.plist */; };
A9AD6F0E2118A39800B38982 /* libRNViewShot.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9AD6F0D2118A38400B38982 /* libRNViewShot.a */; };
A9AD6F152118A53100B38982 /* libRNShare.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9AD6F142118A52B00B38982 /* libRNShare.a */; };
A9B3FB14212161F20090A2B1 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B3FAEA212161E60090A2B1 /* libCodePush.a */; };
A9B5D82D2125CE4F00D8CE85 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A9B5D82C2125CE4F00D8CE85 /* GoogleService-Info.plist */; };
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
C7090988C90343A2A284AB78 /* libRNFirebase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 433B1765955F462E8F8100CA /* libRNFirebase.a */; };
F736E55AB11E83466BB34075 /* libPods-quotes-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CFB2BCB8C04D14B0F1A9DBC /* libPods-quotes-tvOSTests.a */; };
Expand Down Expand Up @@ -410,10 +407,10 @@
8D4B1F60E02F4329944E2E14 /* RealmReact.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RealmReact.xcodeproj; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; };
977626A65BA5C9014407EF13 /* Pods-quotesTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-quotesTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-quotesTests/Pods-quotesTests.release.xcconfig"; sourceTree = "<group>"; };
99FDF8DA57380568B8AFE9F0 /* libPods-quotes-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-quotes-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A949DDC92112DB8500310AA5 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
A9AD6EE22118A38400B38982 /* RNViewShot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNViewShot.xcodeproj; path = "../node_modules/react-native-view-shot/ios/RNViewShot.xcodeproj"; sourceTree = "<group>"; };
A9AD6F0F2118A52B00B38982 /* RNShare.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNShare.xcodeproj; path = "../node_modules/react-native-share/ios/RNShare.xcodeproj"; sourceTree = "<group>"; };
A9B3FAE2212161E60090A2B1 /* CodePush.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CodePush.xcodeproj; path = "../node_modules/react-native-code-push/ios/CodePush.xcodeproj"; sourceTree = "<group>"; };
A9B5D82C2125CE4F00D8CE85 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../Desktop/GoogleService-Info.plist"; sourceTree = "<group>"; };
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
B7AEFED8422F5000E5C86308 /* Pods-quotes-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-quotes-tvOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-quotes-tvOSTests/Pods-quotes-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
C36236289EF776D5D6C08C5C /* libPods-quotes.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-quotes.a"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -588,7 +585,7 @@
isa = PBXGroup;
children = (
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
A949DDC92112DB8500310AA5 /* GoogleService-Info.plist */,
A9B5D82C2125CE4F00D8CE85 /* GoogleService-Info.plist */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
Expand Down Expand Up @@ -874,6 +871,9 @@
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 6UG489CL58;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic;
Expand Down Expand Up @@ -1285,7 +1285,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A949DDF02112DB8500310AA5 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1294,8 +1293,8 @@
buildActionMask = 2147483647;
files = (
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
A9B5D82D2125CE4F00D8CE85 /* GoogleService-Info.plist in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
A949DDEF2112DB8500310AA5 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1304,15 +1303,13 @@
buildActionMask = 2147483647;
files = (
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
A949DDF12112DB8500310AA5 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E48E1E0B4A5D006451C7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A949DDF22112DB8500310AA5 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1686,6 +1683,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 6UG489CL58;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
Expand All @@ -1698,6 +1696,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = io.insider.apps.quotes;
PRODUCT_NAME = quotes;
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -1709,6 +1708,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6UG489CL58;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
Expand All @@ -1721,6 +1721,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = io.insider.apps.quotes;
PRODUCT_NAME = quotes;
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down
4 changes: 2 additions & 2 deletions ios/quotes/Base.lproj/LaunchScreen.xib
Expand Up @@ -15,7 +15,7 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon" translatesAutoresizingMaskIntoConstraints="NO" id="hO0-3S-8D8">
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="IconSplash" translatesAutoresizingMaskIntoConstraints="NO" id="hO0-3S-8D8">
<rect key="frame" x="190" y="190" width="100" height="100"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="3Bp-68-EWS"/>
Expand All @@ -34,6 +34,6 @@
</view>
</objects>
<resources>
<image name="icon" width="512" height="512"/>
<image name="IconSplash" width="143" height="80"/>
</resources>
</document>
23 changes: 23 additions & 0 deletions ios/quotes/Images.xcassets/IconSplash.imageset/Contents.json
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "logo-splash.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "logo-splash@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "logo-splash@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 56 additions & 56 deletions ios/quotes/Info.plist
@@ -1,59 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>For sharing your photos</string>
<key>CFBundleDisplayName</key>
<string>quotes</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>CodePushDeploymentKey</key>
<string>PHK1KXNkGU0iznJYa2F8Vkp-wEodSJyleA6H7</string>
</dict>
</plist>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Quotes</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CodePushDeploymentKey</key>
<string>PHK1KXNkGU0iznJYa2F8Vkp-wEodSJyleA6H7</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need this for sharing your hand picked quotes</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -17,6 +17,7 @@
"react-native-code-push": "^5.4.1",
"react-native-extended-stylesheet": "^0.8.1",
"react-native-firebase": "^4.3.8",
"react-native-iphone-x-helper": "^1.0.3",
"react-native-share": "^1.1.0",
"react-native-side-menu": "^1.1.3",
"react-native-view-shot": "^2.4.0",
Expand Down
5 changes: 5 additions & 0 deletions src/modules/bookmarks/styles.js
@@ -1,5 +1,6 @@
import EStyleSheet from 'react-native-extended-stylesheet';

import { ifIphoneX } from 'react-native-iphone-x-helper/index';
import { colors, fonts } from '../../config';

export default EStyleSheet.create({
Expand All @@ -8,6 +9,10 @@ export default EStyleSheet.create({
padding: 20,
paddingTop: '2rem',
backgroundColor: colors.light,
...ifIphoneX({
paddingTop: 50,
paddingBottom: 50,
}),
},
containerDark: {
backgroundColor: colors.dark,
Expand Down
21 changes: 16 additions & 5 deletions src/modules/quotes/QuotesState.js
Expand Up @@ -193,13 +193,24 @@ export default function QuotesReducer(state = initialState, action) {
(action.payload === BG_TYPES.BG_RANDOM ? state.isDarkBg : true),
};
case TOGGLE_CATEGORY:
const isAllCategoriesSelected =
const selectedCategoriesCount =
// All categories
Object.keys(state.categories)
// Filtered by unselected
.filter(c => !state.categories[c])
// Length is greater than 0
.length === 0;
// Filtered by selected
.filter(c => state.categories[c]);

const isAllCategoriesSelected =
selectedCategoriesCount.length ===
Object.keys(state.categories).length;

const isOnlyOneCategorySelected = selectedCategoriesCount.length === 1;

// If the user tries to unselect the only selected category
if (isOnlyOneCategorySelected && state.categories[action.payload]) {
return {
...state,
};
}

return {
...state,
Expand Down
4 changes: 4 additions & 0 deletions src/modules/quotes/styles.js
@@ -1,4 +1,5 @@
import EStyleSheet from 'react-native-extended-stylesheet';
import { ifIphoneX } from 'react-native-iphone-x-helper';

import { colors, fonts } from '../../config';

Expand All @@ -7,6 +8,9 @@ export default EStyleSheet.create({
flex: 1,
padding: 20,
backgroundColor: colors.light,
...ifIphoneX({
paddingVertical: 30,
}),
},
loadingContainer: {
flex: 1,
Expand Down
5 changes: 5 additions & 0 deletions src/modules/sidebar/styles.js
@@ -1,5 +1,6 @@
import EStyleSheet from 'react-native-extended-stylesheet';

import { ifIphoneX } from 'react-native-iphone-x-helper/index';
import { colors, fonts } from '../../config';

export default EStyleSheet.create({
Expand All @@ -9,6 +10,10 @@ export default EStyleSheet.create({
paddingTop: '2rem',
backgroundColor: colors.dark,
justifyContent: 'space-between',
...ifIphoneX({
paddingTop: 50,
paddingBottom: 30,
}),
},
containerDark: {
backgroundColor: colors.light,
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Expand Up @@ -5380,6 +5380,10 @@ react-native-firebase@^4.3.8:
postinstall-build "^5.0.1"
prop-types "^15.6.1"

react-native-iphone-x-helper@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.0.3.tgz#7a2f1e0574e899a0f1d426e6167fd98990083214"

react-native-safe-area-view@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.7.0.tgz#38f5ab9368d6ef9e5d18ab64212938af3ec39421"
Expand Down

0 comments on commit 60ec5c7

Please sign in to comment.