Skip to content

Commit

Permalink
Merge pull request #1 from theboi/master
Browse files Browse the repository at this point in the history
Update Settings + Home page
  • Loading branch information
theboi authored Mar 17, 2020
2 parents 7c82219 + 0b83780 commit eb49512
Show file tree
Hide file tree
Showing 19 changed files with 265 additions and 124 deletions.
102 changes: 64 additions & 38 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,90 @@
*/

import 'react-native-gesture-handler';
import React, { Reducer } from 'react';
import React, {Fragment} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {connect, ReactReduxContextValue} from 'react-redux';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {
BottomNavigation,
BottomNavigationTab,
ApplicationProvider,
Layout,
Text,
} from '@ui-kitten/components';
import {mapping, light as lightTheme, dark as darkTheme} from '@eva-design/eva';
import {SafeAreaView} from 'react-native';

import {K} from './src/store/constants';

import {HomePage} from './src/pages/Home';
import {SettingsPage} from './src/pages/Settings';
import {FindPage} from './src/pages/Find';


const Tab = createBottomTabNavigator();

const App = (props: any) => {
const themeColor = props.theme === 'dark' ? K.color.dark : K.color.light;
return (
<ApplicationProvider mapping={mapping} theme={props.theme === 'dark' ? darkTheme : lightTheme}>
<NavigationContainer>
<Tab.Navigator
screenOptions={({navigation, route}) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
switch (route.name) {
case 'Home':
iconName = focused
? 'home-variant'
: 'home-variant-outline';
break;
case 'Settings':
iconName = focused ? 'settings' : 'settings-outline';
break;
case 'Find':
iconName = focused ? 'map-marker' : 'map-marker-outline';
break;
default:
iconName = 'alert-circle';
}
return <Icon name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: 'blue',
inactiveTintColor: 'gray',
}}>
<Tab.Screen name="Find" component={FindPage} />
<Tab.Screen name="Home" component={HomePage} />
<Tab.Screen name="Settings" component={SettingsPage} />
</Tab.Navigator>
</NavigationContainer>
</ApplicationProvider>
<Fragment>
<SafeAreaView
style={{
flex: 0,
backgroundColor:
props.theme === 'dark'
? themeColor.linkBG
: themeColor.linkBG,
}}
/>
<SafeAreaView
style={{
flex: 1,
backgroundColor:
props.theme === 'dark'
? themeColor.secondaryBG
: themeColor.secondaryBG,
}}>
<ApplicationProvider
mapping={mapping}
theme={props.theme === 'dark' ? darkTheme : lightTheme}>
<NavigationContainer>
<Tab.Navigator
initialRouteName={'Home'}
screenOptions={({navigation, route}) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
switch (route.name) {
case 'Home':
iconName = focused
? 'home-variant'
: 'home-variant-outline';
break;
case 'Settings':
iconName = focused ? 'settings' : 'settings-outline';
break;
case 'Find':
iconName = focused ? 'map-marker' : 'map-marker-outline';
break;
default:
iconName = 'alert-circle';
}
return <Icon name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: themeColor.contrast,
activeBackgroundColor: themeColor.secondaryBG,
inactiveTintColor: 'gray',
inactiveBackgroundColor: themeColor.secondaryBG,
style: {borderTopColor: themeColor.primaryBG}
}}>
<Tab.Screen name="Find" component={FindPage} />
<Tab.Screen name="Home" component={HomePage} />
<Tab.Screen name="Settings" component={SettingsPage} />
</Tab.Navigator>
</NavigationContainer>
</ApplicationProvider>
</SafeAreaView>
</Fragment>
);
};

Expand Down
4 changes: 2 additions & 2 deletions android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.lost",
package = "com.ryanthe.lostapp",
)

android_resource(
name = "res",
package = "com.lost",
package = "com.ryanthe.lostapp",
res = "src/main/res",
)

Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ android {
}

defaultConfig {
applicationId "com.lost"
applicationId "com.ryanthe.lostapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lost">
package="com.ryanthe.lostapp">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/java/com/lost/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lost;
package com.ryanthe.lostapp;

import com.facebook.react.ReactActivity;

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/java/com/lost/MainApplication.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lost;
package com.ryanthe.lostapp;

import android.app.Application;
import android.content.Context;
Expand Down
20 changes: 11 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
*/

import React from 'react';
import {AppRegistry} from 'react-native';
import { AppRegistry, SafeAreaView } from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import { name as appName } from './app.json';

import { Provider } from 'react-redux';
import {createStore} from 'redux';
import {reducer} from './src/store/reducer';
import { createStore } from 'redux';
import { reducer } from './src/store/reducer';

const store = createStore(reducer);

const RenderApp = () => (
<Provider store={store}>
<App />
</Provider>
const RenderApp = () => {
return (
<Provider store={store}>
<App />
</Provider>
)
}

)
AppRegistry.registerComponent(appName, () => RenderApp);
23 changes: 18 additions & 5 deletions ios/lost.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
CC84885D332AE50C2D0C8EA8 /* Pods-lostTests.debug.xcconfig */,
ADC5F6C3B9286FA673716C6F /* Pods-lostTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -293,12 +292,17 @@
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 66HB97DLV4;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 66HB97DLV4;
ProvisioningStyle = Automatic;
};
2D02E48F1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 66HB97DLV4;
ProvisioningStyle = Automatic;
TestTargetID = 2D02E47A1E0B4A5D006451C7;
};
Expand All @@ -309,6 +313,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -632,6 +637,7 @@
baseConfigurationReference = CC84885D332AE50C2D0C8EA8 /* Pods-lostTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand All @@ -655,6 +661,7 @@
baseConfigurationReference = ADC5F6C3B9286FA673716C6F /* Pods-lostTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = lostTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Expand All @@ -677,14 +684,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 66HB97DLV4;
INFOPLIST_FILE = lost/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.ryanthe.lostapp;
PRODUCT_NAME = lost;
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -696,14 +704,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 66HB97DLV4;
INFOPLIST_FILE = lost/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.ryanthe.lostapp;
PRODUCT_NAME = lost;
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -720,6 +729,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 66HB97DLV4;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "lost-tvOS/Info.plist";
Expand All @@ -729,7 +739,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.lost-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = "com.ryanthe.lostapp-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
Expand All @@ -749,6 +759,7 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 66HB97DLV4;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "lost-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -757,7 +768,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.lost-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = "com.ryanthe.lostapp-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
Expand All @@ -775,6 +786,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 66HB97DLV4;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "lost-tvOSTests/Info.plist";
Expand Down Expand Up @@ -803,6 +815,7 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 66HB97DLV4;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "lost-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down
8 changes: 8 additions & 0 deletions ios/lost.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
36 changes: 18 additions & 18 deletions ios/lost/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
</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>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand All @@ -53,23 +71,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<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>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>
</dict>
</plist>
Loading

0 comments on commit eb49512

Please sign in to comment.