From 932dea9746c0cd8884c56ca2f8d24281866930a7 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 6 Feb 2017 19:01:57 -0700 Subject: [PATCH] Add some usage tips to tips page --- src/actions/actionTypes.js | 1 + src/actions/menuActions.js | 6 ++++++ src/components/menu.js | 4 ++-- src/components/tips.js | 37 +++++++++++++++++++++++++++++++++++++ src/containers/nav.js | 3 +++ src/containers/tipsApp.js | 16 ++++++++++++++++ src/reducers/menu.js | 7 +++++++ 7 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 src/components/tips.js create mode 100644 src/containers/tipsApp.js diff --git a/src/actions/actionTypes.js b/src/actions/actionTypes.js index 11bb904..d84aada 100644 --- a/src/actions/actionTypes.js +++ b/src/actions/actionTypes.js @@ -7,4 +7,5 @@ export const MAIN = 'MAIN'; export const CHART = 'CHART'; export const HELP = 'HELP'; export const EXAMPLE = 'EXAMPLE'; +export const TIPS = 'TIPS'; export const ABOUT = 'ABOUT'; diff --git a/src/actions/menuActions.js b/src/actions/menuActions.js index 3d6e23f..b9b99c4 100644 --- a/src/actions/menuActions.js +++ b/src/actions/menuActions.js @@ -36,6 +36,12 @@ export function example() { }; } +export function tips() { + return { + type: types.TIPS + }; +} + export function about() { return { type: types.ABOUT diff --git a/src/components/menu.js b/src/components/menu.js index 730ba0a..5f6e0b9 100644 --- a/src/components/menu.js +++ b/src/components/menu.js @@ -22,7 +22,7 @@ export default class Menu extends Component { } render() { - const {about, main, chart, help, example} = this.props; + const {about, main, chart, help, tips, example} = this.props; return ( @@ -32,7 +32,7 @@ export default class Menu extends Component { Color Chart Help Example - Tips + Tips About diff --git a/src/components/tips.js b/src/components/tips.js new file mode 100644 index 0000000..c301dab --- /dev/null +++ b/src/components/tips.js @@ -0,0 +1,37 @@ +import React, {Component} from 'react'; +import {ScrollView, View} from 'react-native'; + +import MyText from './mytext.js'; +import Section from './section.js'; + +export default class Tips extends Component { + constructor(props) { + super(props); + } + + render() { + return ( + + +
+ Don't hold both resistor leads while measuring + The resistance of your body added in parallel is enough to effect the measurement of higher valued resistors. Since the purpose of this app is to help you create a precise resistance value, doing so is counterproductive. +
+
+ Don't press the resistor leads against an ESD mat + Most ESD mats are slightly conductive to allow static charges to dissipate. This also has the problem of affecting the resistance measurement of higher valued resistors. +
+
+ Use only one hand to hold the resistor + When measuring the resistors, use only one hand to hold the resistor to a multimeter lead. Grip the other multimeter lead by only the plastic part with your other hand. Then use the tension in the resistor's remaining lead to bring the two together and form a circuit. +
+
+ Increase precision by adding significant figures + You can increase the precision of the calculations shown by the app by adding more significant figures to your target resistance. This way you can make your solution as precise as you need. +
+
+
+ ); + } +} + diff --git a/src/containers/nav.js b/src/containers/nav.js index bf3084a..53e5b34 100644 --- a/src/containers/nav.js +++ b/src/containers/nav.js @@ -12,6 +12,7 @@ import ChartApp from '../containers/chartApp'; import CalcApp from '../containers/calcApp'; import HelpApp from '../containers/helpApp'; import ExampleApp from '../containers/exampleApp'; +import TipsApp from '../containers/tipsApp'; import AboutApp from '../containers/aboutApp'; class Nav extends Component { @@ -67,6 +68,8 @@ class Nav extends Component { return ; case 'example': return ; + case 'tips': + return ; case 'about': return ; default: diff --git a/src/containers/tipsApp.js b/src/containers/tipsApp.js new file mode 100644 index 0000000..8e1fce3 --- /dev/null +++ b/src/containers/tipsApp.js @@ -0,0 +1,16 @@ +'use strict'; + +import React, {Component} from 'react'; +import Tips from '../components/tips'; + +export default class TipsApp extends Component { + constructor(props) { + super(props); + } + + render() { + return ( + + ); + } +} diff --git a/src/reducers/menu.js b/src/reducers/menu.js index 3ce391a..4ade10d 100644 --- a/src/reducers/menu.js +++ b/src/reducers/menu.js @@ -48,6 +48,13 @@ export default function menu(state = initialState, action = {}) { page: 'example', subtitle: 'Example Usage', }; + case types.TIPS: + return { + ...state, + isOpen: false, + page: 'tips', + subtitle: 'Tips', + }; case types.ABOUT: return { ...state,