Skip to content

Commit bbe97be

Browse files
committed
Merged v2 into master
2 parents 1ee70ad + d77265c commit bbe97be

File tree

189 files changed

+9952
-2724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+9952
-2724
lines changed

.eslintrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Use this file as a starting point for your project's .eslintrc.
2+
// Copy this file, and add rule overrides as needed.
3+
{
4+
"extends": "airbnb",
5+
"parser": "babel-eslint",
6+
"ecmaFeatures": {
7+
"classes": true,
8+
},
9+
"rules": {
10+
"react/jsx-filename-extension": ["error", { extensions: [".js", ".jsx"] }],
11+
"global-require": "off",
12+
13+
// Used for debugging
14+
"no-console": "off",
15+
16+
// Because we're using directory aliases eg. @component, @config
17+
"import/no-extraneous-dependencies": "off",
18+
"import/extensions": "off",
19+
"import/no-unresolved": "off"
20+
},
21+
}

.flowconfig

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
[ignore]
2-
3-
# We fork some components by platform.
2+
; We fork some components by platform
43
.*/*[.]android.js
54

6-
# Ignore templates with `@flow` in header
7-
.*/local-cli/generator.*
8-
9-
# Ignore malformed json
10-
.*/node_modules/y18n/test/.*\.json
11-
12-
# Ignore the website subdir
13-
<PROJECT_ROOT>/website/.*
14-
15-
# Ignore BUCK generated dirs
5+
; Ignore "BUCK" generated dirs
166
<PROJECT_ROOT>/\.buckd/
177

18-
# Ignore unexpected extra @providesModule
19-
.*/node_modules/commoner/test/source/widget/share.js
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
2010

21-
# Ignore duplicate module providers
22-
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
2314
.*/Libraries/react-native/React.js
2415
.*/Libraries/react-native/ReactNative.js
25-
.*/node_modules/jest-runtime/build/__tests__/.*
2616

2717
[include]
2818

@@ -34,9 +24,6 @@ flow/
3424
[options]
3525
module.system=haste
3626

37-
esproposal.class_static_fields=enable
38-
esproposal.class_instance_fields=enable
39-
4027
experimental.strict_type_args=true
4128

4229
munge_underscores=true
@@ -48,11 +35,11 @@ suppress_type=$FlowIssue
4835
suppress_type=$FlowFixMe
4936
suppress_type=$FixMe
5037

51-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-5]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-5]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
5340
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5441

5542
unsafe.enable_getters_and_setters=true
5643

5744
[version]
58-
^0.33.0
45+
^0.35.0

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,26 @@ DerivedData
2222
*.xcuserstate
2323
project.xcworkspace
2424

25-
# Android/IJ
25+
# Android/IntelliJ
2626
#
27-
*.iml
27+
build/
2828
.idea
2929
.gradle
3030
local.properties
31+
*.iml
3132

3233
# node.js
3334
#
3435
node_modules/
3536
npm-debug.log
3637

3738
# BUCK
39+
#
3840
buck-out/
3941
\.buckd/
4042
android/app/libs
41-
android/keystores/debug.keystore
43+
*.keystore
4244

43-
# Test coverage
44-
coverage
45+
# Test coverage
46+
#
47+
coverage

README.md

Lines changed: 58 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,72 @@
1-
React Native Starter Kit
2-
=======
1+
![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/rnsk-logo.jpg "React Native Starter Kit")
32

4-
| | | | |
5-
|---|---|---|---|
6-
| ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native.png "React Native") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/redux-logo.png "Redux") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/apple-logo.jpg "iOS Ready") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/android-logo.jpg "Android Ready") |
7-
| | | | |
3+
# React Native Starter Kit
84

9-
### Features
5+
React Native Starter Kit helps you get started with React Native. It contains a bunch of helpful components, building blocks and basic structure to allow you to jump straight into building an app.
106

11-
| Feature | Summary |
12-
|---|---|
13-
| [Redux](https://github.com/reactjs/react-redux) | A predictable state container - Helping you write applications that behave consistently and run in different environments. |
14-
| [Sidebar/Hamburger Menu](https://github.com/Kureev/react-native-side-menu) | ... |
15-
| [Google Analytics](https://github.com/idehub/react-native-google-analytics-bridge) | Shows how to track screen views (includes both a 'debug' mode tracker as well as 'release' mode so that data doesn't get obfuscated). |
16-
| [Custom Navbar](https://github.com/Kureev/react-native-navbar) | ... |
17-
| [Icons](https://github.com/oblador/react-native-vector-icons) | Easily use icons from a wide range of icon libraries, it's as simple as importing the icon font and then `<Icon name={'ios-alert-outline'} size={50} color={"#CCC"} />`. |
18-
| [Form Validation](https://github.com/gcanti/tcomb-form-native) | An example on how to create forms with validation. |
19-
| Data persistence | Shows how to persist data, even after closing/reopening the app. |
20-
| Style Guide | A bunch of elements and components to get you started - styled headings, buttons, list rows, alerts etc. |
21-
| An example directory/file structure I've found useful for scaling apps | ... |
7+
![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/rnsk-v2-screens.jpg "React Native Starter App")
8+
9+
---
2210

11+
## Docs
2312

24-
### Screenshots
13+
1. [Features](#features)
14+
1. **Before you start**
15+
1. [Getting Started with React Native](/docs/react-native.md)
16+
1. [React Native Quick Tips](/docs/quick-tips.md)
17+
1. [Understanding the File Structure](#understanding-the-file-structure)
18+
1. [Opinions Guiding this Project](/docs/opinions.md)
19+
1. **Using RNSK**
20+
1. [Get Up and Running with RNSK](#getting-started)
21+
1. [Routing / Navigating](/src/navigation/README.md)
22+
1. [Using Google Analytics](/docs/google-analytics.md)
23+
1. [Interacting with a REST API](/docs/api.md)
24+
1. [Testing](/docs/testing.md)
25+
1. [Contributing](/docs/contributing.md)
26+
1. [Licence](LICENSE)
2527

26-
| | | |
27-
|---|---|---|
28-
| ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native-starter-app.png "Default Screen w/ tabs") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native-starter-app-open-menu.png "Sidebar Menu open") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native-starter-app-forms.png "Data validation and persistence") |
29-
| ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native-starter-app-listview.png "List View Example") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native-starter-app-listview2.png "List View Example 2") | ![alt text](https://dl.dropboxusercontent.com/u/46690444/GITHUB/react-native-starter-app-style-guide.png "Style Guide") |
30-
| | | |
28+
---
3129

32-
### Getting Started
30+
## Features
31+
32+
| Feature | Summary |
33+
| --- | --- |
34+
| [Redux](https://github.com/reactjs/react-redux) | A predictable state container - Helping you write applications that behave consistently and run in different environments. |
35+
| [React Native Router Flux](https://github.com/aksonov/react-native-router-flux) | Router for React Native based on new React Native Navigation API. <br><br>['How to' Guide &rarr;](/src/navigation/README.md)|
36+
| [API Example](/docs/api.md) | A basic example showing how you can interact with a RESTful API with user authentication (JWT). |
37+
| [Sidebar / Hamburger Menu](https://github.com/react-native-community/react-native-side-menu) | ... |
38+
| [React Native Elements](https://github.com/react-native-community/react-native-elements) | Cross Platform React Native UI Toolkit. |
39+
| [Google Analytics](https://github.com/idehub/react-native-google-analytics-bridge) | Shows how to track screen views (includes both a 'debug' mode tracker as well as 'release' mode so that data doesn't get obfuscated). <br><br>[Setup Guide &rarr;](/docs/google-analytics.md) |
40+
| [React Native Vector Icons](https://github.com/oblador/react-native-vector-icons) | Easily use icons from a wide range of icon libraries, it's as simple as importing the icon font and then `<Icon name={'ios-alert-outline'} size={50} color={"#CCC"} />`. |
41+
| [Tcomb Form Validation](https://github.com/gcanti/tcomb-form-native) | An exmaple on how to create forms with validation. |
42+
| Component Style Guide | A bunch of elements and components to get you started - styled headings, buttons, list rows, alerts etc. |
43+
| Code Linting / Code Style Guide | We're using [Airbnb's](https://github.com/airbnb/javascript) JS/React Style Guide with ESLint linting. <br><br>[Get started with linting for React Native &rarr;](https://medium.com/pvtl/linting-for-react-native-bdbb586ff694) |
44+
| Boilerplate | An example directory/file structure I've found useful for scaling apps <br><br>[Learn more &rarr;](#understanding-the-file-structure) |
45+
46+
---
47+
48+
## Getting Started
3349

3450
1. Ensure you've followed the [React Native - Get Started Guide](https://facebook.github.io/react-native/docs/getting-started.html) for the platform/s of choice
35-
2. Clone this project
36-
3. Run `npm install` from root directory
51+
1. Clone this project `git clone https://github.com/mcnamee/react-native-starter-app.git`
52+
1. Run `npm install` from root directory
53+
1. Start the app in [an emulator](/docs/quick-tips.md#running-in-an-emulator)
54+
55+
---
3756

38-
### Testing
39-
1. `npm run test`
57+
## Understanding the File Structure
4058

41-
### Quick Tips
59+
- `/android` - The native Android stuff
60+
- `/ios` - The native iOS stuff
61+
- `/src` - Contains the full React Native App codebase
62+
- `/components` - 'Dumb-components' / presentational. [Read More &rarr;](/src/components/README.md)
63+
- `/constants` - App-wide variables and config
64+
- `/containers` - 'Smart-components' / the business logic. [Read More &rarr;](/src/containers/README.md)
65+
- `/images` - Self explanatory right?
66+
- `/lib` - Utils, custom libraries, functions
67+
- `/navigation`- Routes - wire up the router with any & all screens. [Read More &rarr;](/src/navigation/README.md)
68+
- `/redux` - Redux Reducers & Actions grouped by type. [Read More &rarr;](/src/redux/README.md)
69+
- `/theme` - Theme specific styles and variables
4270

43-
| Function | iOS | Android |
44-
|---|---|---|
45-
| **Testing project in an emulator** | <ol><li>Open the /ios/StarterKit.xcodeproj file in Xcode</li><li>Select the iOS simulator then press the Play (triangle) icon at the top left</li></ul> | <ol><li>From terminal, run `android avd`. This will open the Android Virtual Device Manager. Select a device to open. </li><li>In a new terminal window, enter the root directory of the project, then run: `react-native run-android`</li></ul> |
46-
| **Running on Device** | [iOS Guide](https://facebook.github.io/react-native/docs/running-on-device-ios.html) | [Android Guide](https://facebook.github.io/react-native/docs/running-on-device-android.html) |
47-
| **Opening the Debug Menu** | CMD + D | CMD + M |
48-
| **Reload** | CMD + R | Double tap R on your keyboard |
49-
| **App Icons** [I use this tool to generate](https://makeappicon.com/) | /ios/StarterKit/Images.xcassets/AppIcon.appiconset | /android/app/src/main/res/mipmap-*/ic_launcher.png |
5071

51-
### Any advice?
5272

53-
Love to hear any feedback or tips to improve - submit an issue or PR.

ReactApp/components/__tests__/__snapshots__/alerts-tests.js.snap

Lines changed: 0 additions & 75 deletions
This file was deleted.

ReactApp/components/__tests__/__snapshots__/button-tests.js.snap

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)