├── packages ├── apps │ ├── .watchmanconfig │ ├── .gitattributes │ ├── .babelrc │ ├── app.json │ ├── android │ │ ├── app │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── apps │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── BUCK │ │ │ ├── proguard-rules.pro │ │ │ └── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── keystores │ │ │ ├── debug.keystore.properties │ │ │ └── BUCK │ │ ├── settings.gradle │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradlew.bat │ │ └── gradlew │ ├── ios │ │ ├── apps │ │ │ ├── Images.xcassets │ │ │ │ ├── Contents.json │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── AppDelegate.h │ │ │ ├── main.m │ │ │ ├── AppDelegate.m │ │ │ ├── Info.plist │ │ │ └── Base.lproj │ │ │ │ └── LaunchScreen.xib │ │ ├── appsTests │ │ │ ├── Info.plist │ │ │ └── appsTests.m │ │ ├── apps-tvOSTests │ │ │ └── Info.plist │ │ ├── apps-tvOS │ │ │ └── Info.plist │ │ └── apps.xcodeproj │ │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── apps.xcscheme │ │ │ └── apps-tvOS.xcscheme │ ├── .buckconfig │ ├── index.js │ ├── webpack.haul.js │ ├── package.json │ ├── .gitignore │ └── .flowconfig ├── shared │ ├── components │ │ ├── Navigator │ │ │ ├── AppsNavigator.js │ │ │ ├── AppsNavigator.web.js │ │ │ └── AppNavigatorSwitch.web.js │ │ ├── Modal │ │ │ ├── Portal.js │ │ │ ├── CustomModal.js │ │ │ └── CustomModal.web.js │ │ ├── PlatformSpecific │ │ │ ├── PlatformComponent.ios.js │ │ │ ├── PlatformComponent.web.js │ │ │ └── PlatformComponent.android.js │ │ └── SharedComponent.js │ ├── screens │ │ ├── HelloScreen.js │ │ ├── DetailScreen.js │ │ ├── AboutScreen.js │ │ ├── NavigationScreen.js │ │ ├── SharedComponentsScreen.js │ │ ├── ModalScreen.js │ │ └── HomeScreen.js │ ├── package.json │ ├── constants │ │ └── routes.js │ ├── yarn.lock │ └── package-lock.json └── web │ ├── template.html │ ├── webpack.prod.js │ ├── webpack.dev.js │ ├── index.web.js │ ├── font.js │ ├── package.json │ ├── webpack.common.js │ └── loaderConfiguration.js ├── .gitignore ├── lerna.json ├── package.json ├── README.md └── yarn.lock /packages/apps/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /packages/apps/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /packages/apps/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | .happyPack 3 | yarn-error.log 4 | .vscode 5 | **/web/dist 6 | lerna-debug.log 7 | -------------------------------------------------------------------------------- /packages/apps/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "React Native plus Web", 3 | "displayName": "React Native plus Web" 4 | } -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | apps 3 | 4 | -------------------------------------------------------------------------------- /packages/apps/ios/apps/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "2.9.0", 3 | "packages": [ 4 | "packages/*" 5 | ], 6 | "version": "0.0.0", 7 | "npmClient": "yarn" 8 | } 9 | -------------------------------------------------------------------------------- /packages/apps/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /packages/apps/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drgx/react-native-plus-web/HEAD/packages/apps/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /packages/apps/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "lerna": "^2.9.0" 4 | }, 5 | "scripts": { 6 | "bootstrap": "lerna bootstrap", 7 | "clean": "lerna clean" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drgx/react-native-plus-web/HEAD/packages/apps/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drgx/react-native-plus-web/HEAD/packages/apps/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drgx/react-native-plus-web/HEAD/packages/apps/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drgx/react-native-plus-web/HEAD/packages/apps/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/apps/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /packages/apps/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'apps' 2 | include ':react-native-svg' 3 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /packages/shared/components/Navigator/AppsNavigator.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StackNavigator } from 'react-navigation'; 3 | import Routes, { initialRouteName } from '../../constants/routes'; 4 | 5 | export default StackNavigator(Routes, initialRouteName); -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/web/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /packages/apps/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /packages/apps/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import Shared from 'shared/components/SharedComponent' 3 | import PlatformSpecific from 'shared/components/PlatformSpecific/PlatformComponent'; 4 | import AppsNavigator from 'shared/components/Navigator/AppsNavigator'; 5 | 6 | AppRegistry.registerComponent('apps', () => AppsNavigator); 7 | -------------------------------------------------------------------------------- /packages/shared/components/Navigator/AppsNavigator.web.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { BrowserRouter as Router } from "react-router-dom"; 3 | import AppNavigatorSwitch from "./AppNavigatorSwitch"; 4 | import {View, Text} from 'react-native'; 5 | export default () => { 6 | return ( 7 | 8 | 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /packages/web/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const commonConfig = require("./webpack.common"); 2 | const webpack = require("webpack"); 3 | const merge = require("webpack-merge"); 4 | 5 | module.exports = merge(commonConfig, { 6 | devtool: 'inline-source-map', 7 | plugins: [ 8 | new webpack.DefinePlugin({ 9 | "process.env.NODE_ENV": JSON.stringify("production") 10 | }), 11 | ] 12 | }); 13 | -------------------------------------------------------------------------------- /packages/shared/components/Modal/Portal.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react' 2 | import ReactDOM from 'react-dom'; 3 | import PropTypes from 'prop-types' 4 | class Portal extends Component { 5 | render(){ 6 | return ReactDOM.createPortal( 7 | this.props.children, 8 | this.props.selector || document.body, 9 | ); 10 | } 11 | } 12 | 13 | Portal.propTypes ={ 14 | selector: PropTypes.string 15 | } 16 | 17 | export default Portal; -------------------------------------------------------------------------------- /packages/apps/android/app/src/main/java/com/apps/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.apps; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "apps"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/apps/ios/apps/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /packages/shared/screens/HelloScreen.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { View, Text, StyleSheet } from "react-native"; 3 | 4 | class HelloScreen extends React.Component { 5 | render() { 6 | return ( 7 | 8 | {'Hello REACT NATIVE!'} 9 | 10 | ); 11 | } 12 | } 13 | 14 | const Styles = StyleSheet.create({ 15 | container: { 16 | flex: 1, 17 | alignItems: "center", 18 | justifyContent: "center" 19 | } 20 | }); 21 | 22 | export default HelloScreen; 23 | -------------------------------------------------------------------------------- /packages/shared/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shared", 3 | "version": "1.0.0", 4 | "description": "shared component between apps and web", 5 | "main": "index.js", 6 | "author": "Ryan Nixon Salim", 7 | "license": "MIT", 8 | "peerDependencies": { 9 | "prop-types": "^15.6.1", 10 | "react": "*", 11 | "react-loadable": "^5.3.1", 12 | "react-native": "*", 13 | "react-native-vector-icons": "^4.5.0", 14 | "react-navigation": "^1.5.8", 15 | "react-router": "^4.2.0" 16 | }, 17 | "dependencies": { 18 | "react": "^16.2.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/apps/ios/apps/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/apps/webpack.haul.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | module.exports = ({ platform }, defaults) => ({ 3 | entry: `./index.js`, 4 | devtool: 'source-map', 5 | resolve: { 6 | ...defaults.resolve, 7 | modules: [path.resolve(__dirname, 'node_modules'), 'node_modules'] 8 | }, 9 | module: { 10 | ...defaults.module, 11 | rules: [ 12 | { 13 | test: /\.js?$/, 14 | include: [ 15 | /node_modules\/@traveloka/, 16 | ], 17 | use: [ 18 | { 19 | loader: 'babel-loader' 20 | } 21 | ] 22 | }, 23 | ...defaults.module.rules, 24 | ] 25 | } 26 | }); -------------------------------------------------------------------------------- /packages/web/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const commonConfig = require("./webpack.common"); 2 | const webpack = require("webpack"); 3 | const merge = require("webpack-merge"); 4 | const path = require("path"); 5 | const devServer = { 6 | contentBase: path.join(__dirname, "dist"), 7 | // enable HMR 8 | hot: true, 9 | // embed the webpack-dev-server runtime into the bundle 10 | inline: true, 11 | // serve index.html in place of 404 responses to allow HTML5 history 12 | historyApiFallback: true, 13 | port: 3000 14 | }; 15 | module.exports = merge(commonConfig, { 16 | devServer, 17 | devtool: "source-map", 18 | plugins: [ 19 | new webpack.DefinePlugin({ 20 | "process.env.NODE_ENV": JSON.stringify("development") 21 | }) 22 | ] 23 | }); 24 | -------------------------------------------------------------------------------- /packages/shared/screens/DetailScreen.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { View, Text, Button, StyleSheet } from "react-native"; 3 | 4 | class Detail extends React.Component { 5 | render() { 6 | return ( 7 | 8 | {`Detail Screen`} 9 | 10 |