From abaf8bb9718468fed1d78ec470dabb0fe8ce13e6 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 25 Sep 2018 18:13:59 +0200 Subject: [PATCH] Add code comments --- App/Containers/Example/ExampleScreen.js | 7 +++++++ App/Containers/Root/RootScreen.js | 2 ++ App/Containers/SplashScreen/SplashScreen.js | 1 + App/Sagas/ExampleSaga.js | 1 + App/Services/WeatherService.js | 6 ++++++ App/Stores/Startup/Actions.js | 1 + 6 files changed, 18 insertions(+) diff --git a/App/Containers/Example/ExampleScreen.js b/App/Containers/Example/ExampleScreen.js index 94e4f9d82..8e687aaa9 100644 --- a/App/Containers/Example/ExampleScreen.js +++ b/App/Containers/Example/ExampleScreen.js @@ -6,6 +6,13 @@ import ExampleActions from 'App/Stores/Example/Actions' import { isHot } from 'App/Stores/Example/Selectors' import Style from './ExampleScreenStyle' +/** + * This is an example of a container component. + * + * This screen displays a little help message and shows the weather temperature. + * Feel free to remove it. + */ + const instructions = Platform.select({ ios: 'Press Cmd+R to reload,\nCmd+D or shake for dev menu.', android: 'Double tap R on your keyboard to reload,\nShake or press menu button for dev menu.', diff --git a/App/Containers/Root/RootScreen.js b/App/Containers/Root/RootScreen.js index 83264b80f..f22fc0c53 100644 --- a/App/Containers/Root/RootScreen.js +++ b/App/Containers/Root/RootScreen.js @@ -18,6 +18,8 @@ const AppNav = createStackNavigator( // Create the application routes here (the key is the route name, the value is the target screen) // See https://reactnavigation.org/docs/en/stack-navigator.html#routeconfigs SplashScreen: SplashScreen, + // The main application screen is our "ExampleScreen". Feel free to replace it with your + // own screen and remove the example. MainScreen: ExampleScreen, }, { diff --git a/App/Containers/SplashScreen/SplashScreen.js b/App/Containers/SplashScreen/SplashScreen.js index cb8a51d84..0cb6cd83b 100644 --- a/App/Containers/SplashScreen/SplashScreen.js +++ b/App/Containers/SplashScreen/SplashScreen.js @@ -7,6 +7,7 @@ export default class SplashScreen extends React.Component { return ( + {/* You will probably want to insert your logo here */} LOGO diff --git a/App/Sagas/ExampleSaga.js b/App/Sagas/ExampleSaga.js index 6ffa9c88b..d987af921 100644 --- a/App/Sagas/ExampleSaga.js +++ b/App/Sagas/ExampleSaga.js @@ -6,6 +6,7 @@ import { WeatherService } from 'App/Services/WeatherService' * A saga can contain multiple functions. * * This example saga contains only one to fetch the weather temperature. + * Feel free to remove it. */ export function* fetchTemperature() { // Dispatch a redux action using `put()` diff --git a/App/Services/WeatherService.js b/App/Services/WeatherService.js index c53d29bc7..15fcb3dfe 100644 --- a/App/Services/WeatherService.js +++ b/App/Services/WeatherService.js @@ -1,6 +1,12 @@ import { create } from 'apisauce' import { Config } from 'App/Config' +/** + * This is an example of a service that connects to a 3rd party API. + * + * Feel free to remove this example from your application. + */ + const weatherApiClient = create({ /** * Import the config from the App/Config/index.js file diff --git a/App/Stores/Startup/Actions.js b/App/Stores/Startup/Actions.js index 91e248210..98042ef44 100644 --- a/App/Stores/Startup/Actions.js +++ b/App/Stores/Startup/Actions.js @@ -1,6 +1,7 @@ import { createActions } from 'reduxsauce' const { Types, Creators } = createActions({ + // This action is triggered when the application starts startup: null, })