-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 989bc99
Showing
23 changed files
with
10,012 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/**/* | ||
.expo/* | ||
npm-debug.* | ||
*.jks | ||
*.p12 | ||
*.key | ||
*.mobileprovision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react'; | ||
import { Platform, StatusBar, StyleSheet, View } from 'react-native'; | ||
import { AppLoading, Asset, Font, Icon } from 'expo'; | ||
import AppNavigator from './navigation/AppNavigator'; | ||
|
||
export default class App extends React.Component { | ||
state = { | ||
isLoadingComplete: false, | ||
}; | ||
|
||
render() { | ||
if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) { | ||
return ( | ||
<AppLoading | ||
startAsync={this._loadResourcesAsync} | ||
onError={this._handleLoadingError} | ||
onFinish={this._handleFinishLoading} | ||
/> | ||
); | ||
} else { | ||
return ( | ||
<View style={styles.container}> | ||
{Platform.OS === 'ios' && <StatusBar barStyle="default" />} | ||
<AppNavigator /> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
_loadResourcesAsync = async () => { | ||
return Promise.all([ | ||
Asset.loadAsync([ | ||
require('./assets/images/robot-dev.png'), | ||
require('./assets/images/robot-prod.png'), | ||
]), | ||
Font.loadAsync({ | ||
// This is the font that we are using for our tab bar | ||
...Icon.Ionicons.font, | ||
// We include SpaceMono because we use it in HomeScreen.js. Feel free | ||
// to remove this if you are not using it in your app | ||
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'), | ||
}), | ||
]); | ||
}; | ||
|
||
_handleLoadingError = error => { | ||
// In this case, you might want to report the error to your error | ||
// reporting service, for example Sentry | ||
console.warn(error); | ||
}; | ||
|
||
_handleFinishLoading = () => { | ||
this.setState({ isLoadingComplete: true }); | ||
}; | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'react-native'; | ||
import React from 'react'; | ||
import App from '../App'; | ||
import renderer from 'react-test-renderer'; | ||
import NavigationTestUtils from 'react-navigation/NavigationTestUtils'; | ||
|
||
describe('App snapshot', () => { | ||
jest.useFakeTimers(); | ||
beforeEach(() => { | ||
NavigationTestUtils.resetInternalState(); | ||
}); | ||
|
||
it('renders the loading screen', async () => { | ||
const tree = renderer.create(<App />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders the root without loading screen', async () => { | ||
const tree = renderer.create(<App skipLoadingScreen />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"expo": { | ||
"name": "The BullETin", | ||
"slug": "BulletinMagExpo", | ||
"privacy": "public", | ||
"sdkVersion": "32.0.0", | ||
"platforms": [ | ||
"ios", | ||
"android" | ||
], | ||
"version": "1.0.0", | ||
"orientation": "portrait", | ||
"icon": "./assets/images/icon.png", | ||
"splash": { | ||
"image": "./assets/images/splash.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#007bbf" | ||
}, | ||
"updates": { | ||
"fallbackToCacheTimeout": 0 | ||
}, | ||
"assetBundlePatterns": [ | ||
"**/*" | ||
], | ||
"ios": { | ||
"supportsTablet": true | ||
} | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = function(api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import { Text } from 'react-native'; | ||
|
||
export class MonoText extends React.Component { | ||
render() { | ||
return <Text {...this.props} style={[this.props.style, { fontFamily: 'space-mono' }]} />; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { Icon } from 'expo'; | ||
|
||
import Colors from '../constants/Colors'; | ||
|
||
export default class TabBarIcon extends React.Component { | ||
render() { | ||
return ( | ||
<Icon.Ionicons | ||
name={this.props.name} | ||
size={26} | ||
style={{ marginBottom: -3 }} | ||
color={this.props.focused ? Colors.tabIconSelected : Colors.tabIconDefault} | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'react-native'; | ||
import React from 'react'; | ||
import { MonoText } from '../StyledText'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
it('renders correctly', () => { | ||
const tree = renderer.create(<MonoText>Snapshot test!</MonoText>).toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const tintColor = '#2f95dc'; | ||
|
||
export default { | ||
tintColor, | ||
tabIconDefault: '#ccc', | ||
tabIconSelected: tintColor, | ||
tabBar: '#fefefe', | ||
errorBackground: 'red', | ||
errorText: '#fff', | ||
warningBackground: '#EAEB5E', | ||
warningText: '#666804', | ||
noticeBackground: tintColor, | ||
noticeText: '#fff', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Dimensions } from 'react-native'; | ||
|
||
const width = Dimensions.get('window').width; | ||
const height = Dimensions.get('window').height; | ||
|
||
export default { | ||
window: { | ||
width, | ||
height, | ||
}, | ||
isSmallDevice: width < 375, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import { createAppContainer, createSwitchNavigator } from 'react-navigation'; | ||
|
||
import MainTabNavigator from './MainTabNavigator'; | ||
|
||
export default createAppContainer(createSwitchNavigator({ | ||
// You could add another route here for authentication. | ||
// Read more at https://reactnavigation.org/docs/en/auth-flow.html | ||
Main: MainTabNavigator, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import { Platform } from 'react-native'; | ||
import { createStackNavigator, createBottomTabNavigator } from 'react-navigation'; | ||
|
||
import TabBarIcon from '../components/TabBarIcon'; | ||
import HomeScreen from '../screens/HomeScreen'; | ||
import LinksScreen from '../screens/LinksScreen'; | ||
import SettingsScreen from '../screens/SettingsScreen'; | ||
|
||
const HomeStack = createStackNavigator({ | ||
Home: HomeScreen, | ||
}); | ||
|
||
HomeStack.navigationOptions = { | ||
tabBarLabel: 'Home', | ||
tabBarIcon: ({ focused }) => ( | ||
<TabBarIcon | ||
focused={focused} | ||
name={ | ||
Platform.OS === 'ios' | ||
? `ios-information-circle${focused ? '' : '-outline'}` | ||
: 'md-information-circle' | ||
} | ||
/> | ||
), | ||
}; | ||
|
||
const LinksStack = createStackNavigator({ | ||
Links: LinksScreen, | ||
}); | ||
|
||
LinksStack.navigationOptions = { | ||
tabBarLabel: 'Links', | ||
tabBarIcon: ({ focused }) => ( | ||
<TabBarIcon | ||
focused={focused} | ||
name={Platform.OS === 'ios' ? 'ios-link' : 'md-link'} | ||
/> | ||
), | ||
}; | ||
|
||
const SettingsStack = createStackNavigator({ | ||
Settings: SettingsScreen, | ||
}); | ||
|
||
SettingsStack.navigationOptions = { | ||
tabBarLabel: 'Settings', | ||
tabBarIcon: ({ focused }) => ( | ||
<TabBarIcon | ||
focused={focused} | ||
name={Platform.OS === 'ios' ? 'ios-options' : 'md-options'} | ||
/> | ||
), | ||
}; | ||
|
||
export default createBottomTabNavigator({ | ||
HomeStack, | ||
LinksStack, | ||
SettingsStack, | ||
}); |
Oops, something went wrong.