Skip to content

Commit

Permalink
Almost here
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarbet committed Jan 11, 2018
1 parent 8d8839e commit 3052c68
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .env_example
@@ -1,6 +1,6 @@
SENTRY_DSN=
SENTRY_PROJECT=
SENTRY_ORG=
SENTRY_PROJECT=
SENTRY_AUTH_TOKEN=

ANDROID_KEYSTORE_ALIAS=
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -44,8 +44,6 @@ buck-out/
# Projects
src/assets/fonts
android/app/*.jks
android/sentry.properties
ios/sentry.properties
.env

# fastlane
Expand Down
5 changes: 5 additions & 0 deletions android/sentry.properties
@@ -0,0 +1,5 @@
defaults.url=https://sentry.io/
defaults.org=project.env.get("SENTRY_ORG")
defaults.project=project.env.get("SENTRY_PROJECT")
auth.token=project.env.get("SENTRY_AUTH_TOKEN")
cli.executable=node_modules/@sentry/cli/bin/sentry-cli
5 changes: 5 additions & 0 deletions ios/sentry.properties
@@ -0,0 +1,5 @@
defaults.url=https://sentry.io/
defaults.org=project.env.get("SENTRY_ORG")
defaults.project=project.env.get("SENTRY_PROJECT")
auth.token=project.env.get("SENTRY_AUTH_TOKEN")
cli.executable=node_modules/@sentry/cli/bin/sentry-cli
2 changes: 1 addition & 1 deletion ios/statiks/Info.plist
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>111</string>
<string>115</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
18 changes: 5 additions & 13 deletions src/components/Placeholders.js
@@ -1,32 +1,24 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, Dimensions, View, Text, Image, TouchableOpacity, Linking } from 'react-native';
import { Sentry, SentrySeverity } from 'react-native-sentry';

import { navigatorTypes } from 'utils/types';
import { v, fonts } from 'Theme';

import { SETTINGS } from '../screens';

const { width } = Dimensions.get('window');

class Empty extends PureComponent {

static propTypes = {
...navigatorTypes,
onPress: PropTypes.func,
}

handlePress = () => {
// Sentry.nativeCrash();

// Promise.reject('Boom promise');

throw new Error('handlePress Error');

this.props.navigator.push({ screen: SETTINGS });
}

render() {
const { onPress } = this.props;

return (
<View style={s.container}>
<Image
Expand Down Expand Up @@ -55,7 +47,7 @@ class Empty extends PureComponent {
}
}

class Error extends PureComponent {
class Critical extends PureComponent {

render() {
return (
Expand Down Expand Up @@ -194,6 +186,6 @@ const s = StyleSheet.create({

export {
Empty,
Error,
Critical,
Loading,
};
6 changes: 2 additions & 4 deletions src/index.js
@@ -1,14 +1,12 @@
import { Navigation } from 'react-native-navigation';
import { Sentry, SentryLog } from 'react-native-sentry';
import { Sentry } from 'react-native-sentry';
import config from 'react-native-config';

import { Screens, startApp } from 'screens';
import Store, { StoreProvider } from 'store';

if (!__DEV__) {
Sentry.config(config.SENTRY_DSN, {
logLevel: SentryLog.Verbose,
}).install();
Sentry.config(config.SENTRY_DSN).install();
}

const store = new Store();
Expand Down
9 changes: 8 additions & 1 deletion src/screens/list/List.js
Expand Up @@ -5,6 +5,7 @@ import { observable, toJS } from 'mobx';

import { navigatorTypes } from 'utils/types';
import { v } from 'Theme';
import { SETTINGS } from 'screens';

import { Empty } from 'components/Placeholders';
import Header from 'components/Header';
Expand Down Expand Up @@ -67,12 +68,18 @@ export default class List extends Component {
this.state.pan.x.removeAllListeners();
}

handleClick() {
this.props.navigator.push({ screen: SETTINGS });
}

render() {
const { navigator, stats } = this.props;
const { data } = stats;
const parsed = toJS(data);

if (data.size <= 0) return <Empty navigator={navigator} />;
if (data.size <= 0) {
return <Empty onPress={this.handleClick} />;
}

return (
<View style={{ flex: 1 }}>
Expand Down

0 comments on commit 3052c68

Please sign in to comment.