Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: move to its own folder #3288

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

#### v4 is based on [React Navigation v2.x](https://reactnavigation.org/). See [this branch](https://github.com/aksonov/react-native-router-flux/tree/v3) and [docs](https://github.com/aksonov/react-native-router-flux/blob/master/README3.md) for v3 based on deprecated React Native Experimental Navigation API. It is not supported and may not work with latest React Native versions.

#### v4.0.0-beta.x is based on [React Navigation v1.5.x](https://reactnavigation.org/). It is also not supported and may not work with the latest React Native versions.
#### v4.0.0-beta.x is based on [React Navigation v1.5.x](https://reactnavigation.org/). See [this branch](https://github.com/aksonov/react-native-router-flux/tree/v4.0.0-beta) for this version. It is also not supported and may not work with the latest React Native versions.

___

* [Example](#try-the-example-app)
* [Examples](#try-the-example-apps)
* [Motivation](https://gist.github.com/aksonov/e2d7454421e44b1c4c72214d14053410)
* [v4 Features](#v4-features)
* [API](/docs/API.md)
Expand Down Expand Up @@ -51,22 +51,20 @@ Actions.refresh({param1: 'hello', param2: 'world'})

For a full listing of the API, [view the API docs](https://github.com/aksonov/react-native-router-flux/blob/master/docs/API.md).

## Try the [example app](https://github.com/aksonov/react-native-router-flux/tree/master/Example)
## Try the [example apps](https://github.com/aksonov/react-native-router-flux/tree/master/examples)

![rnrf](https://user-images.githubusercontent.com/3681859/27937441-ef61d932-626b-11e7-885f-1db7dc74b32e.gif)

```bash
# Get the code
git clone https://github.com/aksonov/react-native-router-flux.git
cd react-native-router-flux/Example
cd react-native-router-flux/examples/[expo|react-native|redux]

# Installing dependencies
yarn
or
npm i

# Run it
react-native run-ios
yarn start
```

## v4 Features
Expand Down
70 changes: 0 additions & 70 deletions ReduxExample/android/app/proguard-rules.pro

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions ReduxExample/android/app/src/main/res/values/strings.xml

This file was deleted.

61 changes: 0 additions & 61 deletions ReduxExample/android/build.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions ReduxExample/android/settings.gradle

This file was deleted.

16 changes: 0 additions & 16 deletions ReduxExample/ios/rnrfSample/AppDelegate.h

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions Example/Example.js → examples/react-native/Example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import CardStackStyleInterpolator from 'react-navigation-stack/dist/views/StackView/StackViewStyleInterpolator';
import { StackViewStyleInterpolator } from 'react-navigation-stack';
import { Scene, Router, Actions, Reducer, ActionConst, Overlay, Tabs, Modal, Drawer, Stack, Lightbox } from 'react-native-router-flux';
import Launch from './components/Launch';
import Register from './components/Register';
Expand Down Expand Up @@ -56,10 +56,15 @@ const getSceneStyle = () => ({
// on Android, the URI prefix typically contains a host in addition to scheme
const prefix = Platform.OS === 'android' ? 'mychat://mychat/' : 'mychat://';

const transitionConfig = () => ({
screenInterpolator:
StackViewStyleInterpolator.forFadeFromBottomAndroid,
});

const Example = () => (
<Router createReducer={reducerCreate} onStateChange={stateHandler} getSceneStyle={getSceneStyle} uriPrefix={prefix}>
<Overlay key="overlay">
<Modal key="modal" hideNavBar transitionConfig={() => ({ screenInterpolator: CardStackStyleInterpolator.forFadeFromBottomAndroid })}>
<Modal key="modal" hideNavBar transitionConfig={transitionConfig}>
<Lightbox key="lightbox">
<Stack key="root" titleStyle={{ alignSelf: 'center' }}>
<Scene key="echo" back clone component={EchoView} getTitle={({ navigation }) => navigation.state.key} />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions Example/package.json → examples/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"postinstall": "rm -rf node_modules/react-native-router-flux/node_modules node_modules/react-native-router-flux/Example node_modules/react-native-router-flux/ReduxExample"
"postinstall": "node_modules/.bin/rnrf dedup"
},
"resolutions": {
"*/@babel/cli": "7.0.0-beta.47",
Expand All @@ -20,8 +20,10 @@
"react-native": "0.56.0",
"react-native-button": "^2.3.0",
"react-native-message-bar": "^2.0.10",
"react-native-router-flux": "file:..",
"react-navigation": "2.13.x"
"react-native-router-flux": "file:../..",
"react-native-router-flux-cli": "file:../../packages/react-native-router-flux-cli",
"react-navigation": "2.13.x",
"react-navigation-stack": "^0.4.0"
},
"devDependencies": {
"@babel/code-frame": "7.0.0-beta.47",
Expand Down
File renamed without changes.
17 changes: 16 additions & 1 deletion Example/yarn.lock → examples/react-native/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4449,6 +4449,11 @@ react-native-message-bar@^2.0.10:
version "2.0.10"
resolved "https://registry.yarnpkg.com/react-native-message-bar/-/react-native-message-bar-2.0.10.tgz#34632bdf2cbfe0f51ae4f1e9a91c42b4394a11c2"

"react-native-router-flux-cli@file:../packages/react-native-router-flux-cli":
version "0.0.1"
dependencies:
rimraf "^2.6.2"

"react-native-router-flux@file:..":
version "4.0.2-dev"
dependencies:
Expand All @@ -4464,6 +4469,10 @@ react-native-safe-area-view@^0.9.0:
dependencies:
hoist-non-react-statics "^2.3.1"

react-native-screens@^1.0.0-alpha.8:
version "1.0.0-alpha.9"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.9.tgz#0d036192e248d454cb7601b659e7630fd0e37e9d"

react-native-tab-view@^0.0.77:
version "0.0.77"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz#11ceb8e7c23100d07e628dc151b57797524d00d4"
Expand Down Expand Up @@ -4548,6 +4557,12 @@ [email protected]:
version "0.3.0"
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.3.0.tgz#cdd056771e5fd12114811824653b1ec7e9ae5de1"

react-navigation-stack@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.4.0.tgz#6e1f0800c086ceedfb38005ae20d50c4877396ef"
dependencies:
react-native-screens "^1.0.0-alpha.8"

[email protected]:
version "0.7.0"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.7.0.tgz#c89d41e501043f7fdb38550de85814452c3e6104"
Expand Down Expand Up @@ -4848,7 +4863,7 @@ right-align@^0.1.1:
dependencies:
align-text "^0.1.1"

rimraf@^2.5.4, rimraf@^2.6.1:
rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
dependencies:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.rnrfsample",
package = "com.rnrfreduxsample",
)

android_resource(
name = "res",
package = "com.rnrfsample",
package = "com.rnrfreduxsample",
res = "src/main/res",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ import com.android.build.OutputFile
* ]
*/

project.ext.react = [
entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
Expand All @@ -94,7 +98,7 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.rnrfsample"
applicationId "com.rnrfreduxsample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand Down
17 changes: 17 additions & 0 deletions examples/redux/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rnrfsample"
android:versionCode="1"
android:versionName="1.0">
package="com.rnrfreduxsample">

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

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnrfsample;
package com.rnrfreduxsample;

import com.facebook.react.ReactActivity;

Expand All @@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "rnrfSample";
return "rnrfReduxSample";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rnrfsample;
package com.rnrfreduxsample;

import android.app.Application;

Expand All @@ -25,6 +25,11 @@ protected List<ReactPackage> getPackages() {
new MainReactPackage()
);
}

@Override
protected String getJSMainModuleName() {
return "index";
}
};

@Override
Expand Down
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.
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.
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