Verified Commit dbfb6cb5 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix i18next-react and iPhone X notch support

parent 4fe269da
import PropTypes from 'prop-types';
import React from 'react';
import { translate } from 'react-i18next';
import { withTranslation } from 'react-i18next';
import { Text, View } from 'react-native';
import Moment from 'moment';
import CardSection from '../../components/cardSection/CardSection';
......@@ -70,4 +70,4 @@ PersonalInfoSection.propTypes = {
openUrl: PropTypes.func.isRequired,
};
export default translate('screens/profile/PersonalInfoSection')(PersonalInfoSection);
export default withTranslation('screens/profile/PersonalInfoSection')(PersonalInfoSection);
......@@ -9,7 +9,7 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import { translate } from 'react-i18next';
import { withTranslation } from 'react-i18next';
import LinearGradient from 'react-native-linear-gradient';
import Icon from 'react-native-vector-icons/MaterialIcons';
import ErrorScreen from '../../components/errorScreen/ErrorScreen';
......@@ -230,4 +230,4 @@ ProfileScreen.propTypes = {
goBack: PropTypes.func.isRequired,
};
export default translate('screens/profile/ProfileScreen')(ProfileScreen);
export default withTranslation('screens/profile/ProfileScreen')(ProfileScreen);
import React, { Component } from 'react';
import { Switch, Text, View } from 'react-native';
import PropTypes from 'prop-types';
import { translate } from 'react-i18next';
import { withTranslation } from 'react-i18next';
import styles from './style/NotificationsSection';
import Colors from '../../style/Colors';
......@@ -106,4 +106,4 @@ NotificationsSection.propTypes = {
t: PropTypes.func.isRequired,
};
export default translate('screens/settings/NotificationsSection')(NotificationsSection);
export default withTranslation('screens/settings/NotificationsSection')(NotificationsSection);
......@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {
Text, TouchableHighlight, TouchableOpacity, View,
} from 'react-native';
import { translate } from 'react-i18next';
import { withTranslation } from 'react-i18next';
import Moment from 'moment';
import styles from './style/EventDetailCard';
......@@ -96,4 +96,4 @@ EventDetailCard.propTypes = {
t: PropTypes.func.isRequired,
};
export default translate(['screens/welcome/EventDetailCard'])(EventDetailCard);
export default withTranslation('screens/welcome/EventDetailCard')(EventDetailCard);
......@@ -9,7 +9,7 @@ import {
View,
} from 'react-native';
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withTranslation } from 'react-i18next';
import Moment from 'moment';
import EventDetailCard from './EventDetailCardConnector';
import LoadingScreen from '../../components/loadingScreen/LoadingScreen';
......@@ -69,7 +69,7 @@ const mapDispatchToFooterProps = {
openCalendar: calendarActions.open,
};
const FooterComponent = connect(() => ({}), mapDispatchToFooterProps)(translate('screens/welcome/WelcomeScreen')(Footer));
const FooterComponent = connect(() => ({}), mapDispatchToFooterProps)(withTranslation('screens/welcome/WelcomeScreen')(Footer));
class WelcomeScreen extends Component {
handleRefresh = () => {
......@@ -160,4 +160,4 @@ WelcomeScreen.propTypes = {
t: PropTypes.func.isRequired,
};
export default translate('screens/welcome/WelcomeScreen')(withStandardHeader(WelcomeScreen, true));
export default withTranslation('screens/welcome/WelcomeScreen')(withStandardHeader(WelcomeScreen, true));
import i18n from 'i18next';
import { reactI18nextModule } from 'react-i18next';
import { initReactI18next } from 'react-i18next';
import i18nextReactNative from 'i18next-react-native-language-detector';
import locales from '../assets/locales/index';
i18n
.use(reactI18nextModule)
.use(initReactI18next)
.use(i18nextReactNative)
.init({
nsSeparator: false,
......
import locale from 'react-native-locale-detector';
let server = 'https://thalia.nu';
let server = 'https://staging.thalia.nu';
/* istanbul ignore next line */
if (__DEV__) { // eslint-disable-line no-undef
server = 'http://localhost:8000';
// server = 'http://localhost:8000';
}
export const url = server;
......
......@@ -5,7 +5,6 @@
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
......@@ -39,6 +38,7 @@
2DCD954D1E0B4F2C00145EB5 /* ThaliAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ThaliAppTests.m */; };
2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
2F6E0641344C43BD8556F071 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DCCD2767C1244F58838A52AC /* Ionicons.ttf */; };
3238F61D229F16FE00BEB7F8 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3238F61A229F16F400BEB7F8 /* libRNDeviceInfo.a */; };
327DC4A2229EB48000DE29E9 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 327DC4A1229EB48000DE29E9 /* GoogleService-Info.plist */; };
327DC54B229EB8E100DE29E9 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 327DC537229EB6C300DE29E9 /* libBVLinearGradient.a */; };
327DC54C229EB8E100DE29E9 /* libRNScreens.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 327DC527229EB68D00DE29E9 /* libRNScreens.a */; };
......@@ -204,6 +204,20 @@
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
remoteInfo = "double-conversion-tvOS";
};
3238F619229F16F400BEB7F8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3238F614229F16F300BEB7F8 /* RNDeviceInfo.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = DA5891D81BA9A9FC002B4DB2;
remoteInfo = RNDeviceInfo;
};
3238F61B229F16F400BEB7F8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3238F614229F16F300BEB7F8 /* RNDeviceInfo.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = E72EC1401F7ABB5A0001BC90;
remoteInfo = "RNDeviceInfo-tvOS";
};
327DC48C229EB42900DE29E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
......@@ -476,6 +490,7 @@
2D02E4901E0B4A5D006451C7 /* ThaliApp-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ThaliApp-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
2F20D59838BD63F955316D16 /* Pods-ThaliAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThaliAppTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ThaliAppTests/Pods-ThaliAppTests.release.xcconfig"; sourceTree = "<group>"; };
3238F614229F16F300BEB7F8 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNDeviceInfo.xcodeproj; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = "<group>"; };
327DC4A1229EB48000DE29E9 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
327DC4A3229EB53A00DE29E9 /* ThaliApp.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; name = ThaliApp.entitlements; path = ThaliApp/ThaliApp.entitlements; sourceTree = "<group>"; };
327DC4B2229EB5A700DE29E9 /* RNSentry.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNSentry.xcodeproj; path = "../node_modules/react-native-sentry/ios/RNSentry.xcodeproj"; sourceTree = "<group>"; };
......@@ -526,6 +541,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3238F61D229F16FE00BEB7F8 /* libRNDeviceInfo.a in Frameworks */,
327DC59C229EBC1500DE29E9 /* libRNGestureHandler.a in Frameworks */,
327DC54B229EB8E100DE29E9 /* libBVLinearGradient.a in Frameworks */,
327DC54C229EB8E100DE29E9 /* libRNScreens.a in Frameworks */,
......@@ -734,6 +750,15 @@
name = Frameworks;
sourceTree = "<group>";
};
3238F615229F16F300BEB7F8 /* Products */ = {
isa = PBXGroup;
children = (
3238F61A229F16F400BEB7F8 /* libRNDeviceInfo.a */,
3238F61C229F16F400BEB7F8 /* libRNDeviceInfo-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
327DC466229EB42900DE29E9 /* Recovered References */ = {
isa = PBXGroup;
children = (
......@@ -853,6 +878,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
3238F614229F16F300BEB7F8 /* RNDeviceInfo.xcodeproj */,
327DC542229EB76A00DE29E9 /* RNGestureHandler.xcodeproj */,
327DC522229EB68D00DE29E9 /* RNScreens.xcodeproj */,
327DC4E4229EB5CA00DE29E9 /* RNShare.xcodeproj */,
......@@ -1094,6 +1120,10 @@
ProductGroup = 146834001AC3E56700842450 /* Products */;
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
},
{
ProductGroup = 3238F615229F16F300BEB7F8 /* Products */;
ProjectRef = 3238F614229F16F300BEB7F8 /* RNDeviceInfo.xcodeproj */;
},
{
ProductGroup = 327DC494229EB42900DE29E9 /* Products */;
ProjectRef = 13BDFD6446B9442B9FDACCF9 /* RNFirebase.xcodeproj */;
......@@ -1257,6 +1287,20 @@
remoteRef = 2DF0FFE82056DD460020B375 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
3238F61A229F16F400BEB7F8 /* libRNDeviceInfo.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNDeviceInfo.a;
remoteRef = 3238F619229F16F400BEB7F8 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
3238F61C229F16F400BEB7F8 /* libRNDeviceInfo-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRNDeviceInfo-tvOS.a";
remoteRef = 3238F61B229F16F400BEB7F8 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
327DC48D229EB42900DE29E9 /* libjsi.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12118"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -32,6 +33,7 @@
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<viewLayoutGuide key="safeArea" id="igt-bp-ddH"/>
<point key="canvasLocation" x="558" y="573.5"/>
</view>
</objects>
......
<?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>CFBundleDisplayName</key>
<string>ThaliApp</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>2.7.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>17</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
<string>mailto</string>
</array>
<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>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>ThaliApp</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>2.7.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>17</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
<string>mailto</string>
</array>
<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/>
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
......@@ -6977,6 +6977,11 @@ react-lifecycles-compat@^3.0.4:
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
react-native-device-info@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-2.0.2.tgz#ec0f30c882da376cd729c90d7c80a37e2df5ffaf"
integrity sha512-+AbBBFkxJdFqHrXajVMzowLUhpU77QGeLwxVlkWuZA7u9NVbUrkyGBr6B9+6TPeGKzzRFAy+ciFqnGwuER4roQ==
react-native-dotenv@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-0.2.0.tgz#311551cb6a35a3dcfede648bded55c0e3ece579d"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment