Skip to content

Commit

Permalink
Upgrading to ex-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrd committed Sep 4, 2016
1 parent 2f06654 commit fa15065
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 203 deletions.
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": ["react-native-stage-0/decorator-support"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# OSX
.DS_Store

# node.js
node_modules/
npm-debug.log

# Exponent
.exponent
node_modules/**/*
.exponent/**/*
86 changes: 0 additions & 86 deletions ExHeader.js

This file was deleted.

74 changes: 0 additions & 74 deletions ExScreen.js

This file was deleted.

10 changes: 6 additions & 4 deletions OrgView.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { connect } from 'react-redux';

let React = require('react-native');
let Swipeout = require('react-native-swipeout');
let Org = require('./org/org');
let Parser = require('./org/org_parser');
let Moment = require('moment');

let {
import { connect } from 'react-redux';

import React, {Component} from 'react';

import {
ListView,
Picker,
Text,
TextInput,
TouchableHighlight,
TouchableWithoutFeedback,
View
} = React;
} from 'react-native';


/***** Actions *****/
Expand Down
21 changes: 21 additions & 0 deletions exp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Org Squared",
"description": "Org mode client",
"slug": "org-squared",
"sdkVersion": "9.0.0",
"version": "0.0.0",
"orientation": "portrait",
"primaryColor": "#cccccc",
"iconUrl": "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png",
"notification": {
"iconUrl": "https://s3.amazonaws.com/exp-us-standard/placeholder-push-icon-blue-circle.png",
"color": "#000000"
},
"loading": {
"iconUrl": "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png",
"hideExponentText": false
},
"packagerOpts": {
"assetExts": ["ttf"]
}
}
121 changes: 89 additions & 32 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,99 @@
/**
* Entry point for org_squared app
*/
'use strict';
/** In order for logging to stream to XDE or the exp CLI you must import the
* exponent module at some point in your app */
import Exponent from 'exponent';

import { Provider } from 'react-redux';
import { combineReducers, createStore } from 'redux';
let React = require('react-native');
let {
import React from 'react';
import {
AppRegistry,
Platform,
StatusBar,
StyleSheet,
} = React;
View,
} from 'react-native';
import {
createRouter,
NavigationProvider,
StackNavigation,
} from '@exponent/ex-navigation';
import {
FontAwesome,
} from '@exponent/vector-icons';

// import Router from './navigation/Router';
// import cacheAssetsAsync from './utilities/cacheAssetsAsync';

let ExScreen = require('./ExScreen');
import { Provider } from 'react-redux';
import { combineReducers, createStore } from 'redux';
let OrgView = require('./OrgView');

function OrgSquared() {
const store = createStore(combineReducers({
doc: OrgView.orgAction,
focus: OrgView.focus
}));

return (
<Provider store={store}>
<ExScreen
title="org_squared"
scrollEnabled={true}
style={styles.container}>
<OrgView.EntryView />
</ExScreen>
</Provider>
);
};

let styles = StyleSheet.create({

const Router = createRouter(() => ({
home: () => OrgView.EntryView,
}));

class AppContainer extends React.Component {
state = {
appIsReady: true,
// appIsReady: false,
}

// componentWillMount() {
// this._loadAssetsAsync();
// }

// async _loadAssetsAsync() {
// await cacheAssetsAsync({
// images: [
// require('./assets/images/exponent-wordmark.png'),
// ],
// fonts: [
// FontAwesome.font,
// {'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf')},
// ],
// });

// this.setState({appIsReady: true});
// }

render() {
if (this.state.appIsReady) {
let { notification } = this.props.exp;
const store = createStore(combineReducers({
doc: OrgView.orgAction,
focus: OrgView.focus
}));

return (
<View style={styles.container}>
<Provider store={store}>
<NavigationProvider router={Router}>
<StackNavigation
id="root"
initialRoute={Router.getRoute('home')}
/>
</NavigationProvider>

{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
{Platform.OS === 'android' && <View style={styles.statusBarUnderlay} />}
</Provider>
</View>
);

} else {
return <Exponent.Components.AppLoading />;
}
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff'
}
backgroundColor: '#fff',
},
statusBarUnderlay: {
height: 24,
backgroundColor: 'rgba(0,0,0,0.2)',
},
});

AppRegistry.registerComponent('main', () => OrgSquared);
AppRegistry.registerComponent('main', () => AppContainer);
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"license": "MIT",
"description": "Flexible & extensible Org mode client",
"author": "David Dohan",
"author": "David Dohan <dmrdohan@gmail.com>",
"private": true,
"main": "main.js",
"scripts": {
Expand All @@ -14,8 +14,15 @@
"sdkVersion": "5.0.0"
},
"dependencies": {
"react": "^0.14.5",
"react-native": "github:exponentjs/react-native#sdk-5.0.0",
"@exponent/ex-navigation": "^1.5.8",
"@exponent/samples": "^1.0.2",
"@exponent/vector-icons": "^1.0.1",
"babel-preset-react-native-stage-0": "^1.0.1",
"exponent": "^9.0.2",
"lodash": "^4.13.1",
"react": "15.2.1",
"react-native": "github:exponentjs/react-native#sdk-9.0.0",

"react-native-swipeout": "^2.0.12",
"react-redux": "^4.4.5",
"redux": "^3.5.2"
Expand Down

0 comments on commit fa15065

Please sign in to comment.