├── System_Equation_New ├── .watchmanconfig ├── .eslintrc.json ├── src │ ├── actions │ │ ├── index.js │ │ ├── types.js │ │ ├── HistoryAction.js │ │ └── ConstActions.js │ ├── .DS_Store │ ├── images │ │ ├── .DS_Store │ │ ├── arrow.png │ │ ├── background.png │ │ ├── parenthesis.png │ │ └── parenthesisForHisPage.png │ ├── components │ │ ├── .DS_Store │ │ ├── common │ │ │ ├── index.js │ │ │ ├── CardContent.js │ │ │ ├── Spinner.js │ │ │ ├── Card.js │ │ │ ├── Header.js │ │ │ ├── Button.js │ │ │ └── Input.js │ │ ├── GreetingPage.js │ │ ├── ListItem.js │ │ ├── HistoryPage.js │ │ ├── ConstEnteringSec.js │ │ └── EquationPage.js │ ├── reducers │ │ ├── HistoryPageReducer.js │ │ ├── index.js │ │ └── EquationPageReducer.js │ ├── Router.js │ └── Appp.js ├── .DS_Store ├── app.json ├── .babelrc ├── App.js ├── App.test.js ├── .gitignore ├── package.json └── README.md ├── .DS_Store ├── .idea ├── misc.xml ├── vcs.xml ├── modules.xml ├── system-equation-solver.iml └── workspace.xml ├── LICENSE └── README.md /System_Equation_New/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /System_Equation_New/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb" 3 | } -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/.DS_Store -------------------------------------------------------------------------------- /System_Equation_New/src/actions/index.js: -------------------------------------------------------------------------------- 1 | export * from './ConstActions'; 2 | export * from './HistoryAction'; 3 | -------------------------------------------------------------------------------- /System_Equation_New/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/.DS_Store -------------------------------------------------------------------------------- /System_Equation_New/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/.DS_Store -------------------------------------------------------------------------------- /System_Equation_New/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "sdkVersion": "27.0.0", 4 | "orientation": "portrait" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /System_Equation_New/src/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/images/.DS_Store -------------------------------------------------------------------------------- /System_Equation_New/src/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/images/arrow.png -------------------------------------------------------------------------------- /System_Equation_New/src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/components/.DS_Store -------------------------------------------------------------------------------- /System_Equation_New/src/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/images/background.png -------------------------------------------------------------------------------- /System_Equation_New/src/images/parenthesis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/images/parenthesis.png -------------------------------------------------------------------------------- /System_Equation_New/src/images/parenthesisForHisPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rezaandwenhao/MATH-UP/HEAD/System_Equation_New/src/images/parenthesisForHisPage.png -------------------------------------------------------------------------------- /System_Equation_New/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-expo"], 3 | "env": { 4 | "development": { 5 | "plugins": ["transform-react-jsx-source"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /System_Equation_New/App.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import Appp from './src/Appp'; 3 | 4 | AppRegistry.registerComponent('auth', () => Appp); 5 | 6 | export default Appp; -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/index.js: -------------------------------------------------------------------------------- 1 | export * from './Button'; 2 | export * from './Card'; 3 | export * from './CardContent'; 4 | export * from './Header'; 5 | export * from './Input'; 6 | export * from './Spinner'; 7 | -------------------------------------------------------------------------------- /System_Equation_New/src/actions/types.js: -------------------------------------------------------------------------------- 1 | export const X1CONST_CHANGED = 'x1Const_Changed'; 2 | export const Y1CONST_CHANGED = 'y1Const_Changed'; 3 | export const CONST1_CHANGED = 'const1_Changed'; 4 | export const PULL_HISTORY = 'pull_History'; 5 | -------------------------------------------------------------------------------- /System_Equation_New/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import App from './App'; 3 | 4 | import renderer from 'react-test-renderer'; 5 | 6 | it('renders without crashing', () => { 7 | const rendered = renderer.create().toJSON(); 8 | expect(rendered).toBeTruthy(); 9 | }); 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /System_Equation_New/src/reducers/HistoryPageReducer.js: -------------------------------------------------------------------------------- 1 | import { 2 | PULL_HISTORY 3 | } from '../actions/types'; 4 | 5 | const INITIAL_STATE = {}; 6 | 7 | export default (state = INITIAL_STATE, action) => { 8 | switch (action.type) { 9 | case PULL_HISTORY: 10 | return action.payload; 11 | default: 12 | return state; 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /System_Equation_New/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # expo 4 | .expo/ 5 | 6 | # dependencies 7 | /node_modules 8 | 9 | # misc 10 | .env.local 11 | .env.development.local 12 | .env.test.local 13 | .env.production.local 14 | 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | -------------------------------------------------------------------------------- /System_Equation_New/src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux'; 2 | //diff piece of reducers play toghether 3 | import EquationPageReducer from './EquationPageReducer'; 4 | import HistoryPageReducer from './HistoryPageReducer'; 5 | 6 | export default combineReducers({ 7 | //pass an object with single key "library" 8 | //always return an array 9 | equationPage: EquationPageReducer, 10 | historyPage: HistoryPageReducer 11 | }); 12 | -------------------------------------------------------------------------------- /.idea/system-equation-solver.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/CardContent.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | const CardContent = (props) => { 5 | return ( 6 | 7 | {props.children} 8 | 9 | ); 10 | }; 11 | 12 | const styles = { 13 | containerStyle: { 14 | padding: 5, 15 | justifyContent: 'flex-start', 16 | flexDirection: 'row', 17 | borderColor: '#ddd', 18 | position: 'relative', 19 | flex: 1 20 | } 21 | }; 22 | 23 | export { CardContent }; 24 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/Spinner.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, ActivityIndicator } from 'react-native'; 3 | 4 | const Spinner = ({ size }) => { 5 | return ( 6 | 7 | 11 | 12 | ); 13 | }; 14 | 15 | const styles = { 16 | spinnerStyle: { 17 | flex: 1, 18 | justifyContent: 'center', 19 | alignItems: 'center' 20 | } 21 | }; 22 | 23 | export { Spinner }; 24 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/Card.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | 4 | const Card = (props) => { 5 | return ( 6 | 7 | {props.children} 8 | 9 | ); 10 | }; 11 | 12 | const styles = { 13 | containerStyle: { 14 | borderWidth: 1, 15 | borderRadius: 2, 16 | borderColor: '#ddd', 17 | borderBottomWidth: 0, 18 | shadowColor: '#000', 19 | shadowOffset: { width: 0, height: 2 }, 20 | shadowOpacity: 0.1, 21 | shadowRadius: 2, 22 | elevation: 1, 23 | marginLeft: 5, 24 | marginRight: 5, 25 | marginTop: 10 26 | } 27 | }; 28 | 29 | export { Card }; 30 | -------------------------------------------------------------------------------- /System_Equation_New/src/reducers/EquationPageReducer.js: -------------------------------------------------------------------------------- 1 | import { 2 | X1CONST_CHANGED, 3 | Y1CONST_CHANGED, 4 | CONST1_CHANGED 5 | } from '../actions/types'; 6 | 7 | const INITIAL_STATE = { 8 | x1Const: '', 9 | y1Const: '', 10 | const1: '' 11 | }; 12 | 13 | export default (state = INITIAL_STATE, action) => { 14 | switch (action.type) { 15 | case X1CONST_CHANGED: 16 | //console.log(action); 17 | return { ...state, x1Const: action.payload }; 18 | case Y1CONST_CHANGED: 19 | return { ...state, y1Const: action.payload }; 20 | case CONST1_CHANGED: 21 | return { ...state, const1: action.payload }; 22 | default: 23 | return state; 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /System_Equation_New/src/actions/HistoryAction.js: -------------------------------------------------------------------------------- 1 | import firebase from 'firebase'; 2 | import { PULL_HISTORY } from './types'; 3 | 4 | export const historyFetch = (name) => { 5 | return (dispatch) => { 6 | firebase.database().ref(`/users/${name}`).once('value') 7 | /*(function (snapshot) { 8 | snapshot.forEach(function (childSnapshot) { 9 | //console.log(childSnapshot.key); 10 | console.log(childSnapshot.val()); 11 | dispatch({ type: PULL_HISTORY, payload: childSnapshot.val() });*/ 12 | .then(function (snapshot) { 13 | //console.log(snapshot.val()); 14 | dispatch({ type: PULL_HISTORY, payload: snapshot.val() }); 15 | }); 16 | }; 17 | }; 18 | //}; 19 | -------------------------------------------------------------------------------- /System_Equation_New/src/Router.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Scene, Router, Actions } from 'react-native-router-flux'; 3 | import HistoryPage from './components/HistoryPage'; 4 | import EquationPage from './components/EquationPage'; 5 | import GreetingPage from './components/GreetingPage' 6 | 7 | const RouterComponent = () => { 8 | return ( 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | ); 22 | }; 23 | 24 | export default RouterComponent; 25 | -------------------------------------------------------------------------------- /System_Equation_New/src/actions/ConstActions.js: -------------------------------------------------------------------------------- 1 | import { 2 | X1CONST_CHANGED, 3 | Y1CONST_CHANGED, 4 | CONST1_CHANGED 5 | } from './types'; 6 | 7 | export const x1ConstChanged = (text) => { 8 | return { 9 | type: X1CONST_CHANGED, 10 | payload: text.replace(/[^-^0-9^.^/]/g, ''), 11 | }; 12 | }; 13 | 14 | export const y1ConstChanged = (text) => { 15 | return { 16 | type: Y1CONST_CHANGED, 17 | payload: text.replace(/[^-^0-9^.^/]/g, ''), 18 | }; 19 | }; 20 | 21 | export const const1Changed = (text) => { 22 | return { 23 | type: CONST1_CHANGED, 24 | payload: text.replace(/[^-^0-9^.^/]/g, ''), 25 | }; 26 | }; 27 | 28 | /*export const storeInput = ({ x1Const, y1Const, const1, x2Const, y2Const, const2, name }) => { 29 | return () => { 30 | firebase.database().ref(`/users/${name}/employees`) 31 | .push({ x1Const, y1Const, const1, x2Const, y2Const, const2 }); 32 | }; 33 | };*/ 34 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/Header.js: -------------------------------------------------------------------------------- 1 | //import libs for making a component 2 | import React from 'react'; 3 | import { Text, View } from 'react-native'; 4 | 5 | //Make a component 6 | const Header = (props) => { 7 | const { textStyle, viewStyle } = styles; 8 | 9 | return ( 10 | 11 | {props.headerText} 12 | 13 | ); 14 | //when you have multi lines of return, you use "()" 15 | }; 16 | 17 | const styles = { 18 | viewStyle: { 19 | backgroundColor: '#F8F8F8', 20 | justifyContent: 'center', 21 | alignItems: 'center', 22 | height: 60, 23 | paddingTop: 15, 24 | shadowColor: '#000', 25 | shadowOffset: { width: 0, height: 5 }, 26 | shadowOpacity: 0.5, 27 | elevation: 2, 28 | position: 'relative' 29 | }, 30 | textStyle: { 31 | fontSize: 20 32 | } 33 | }; 34 | //Make the component available to other parts of the app 35 | export { Header }; 36 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, TouchableOpacity } from 'react-native'; 3 | 4 | const Button = ({ whenPressed, text }) => { 5 | //get the prop whenPressed from parent 6 | const { buttonStyle, textStyle } = styles; 7 | return ( 8 | 9 | 10 | {text} 11 | 12 | 13 | ); 14 | }; 15 | 16 | const styles = { 17 | textStyle: { 18 | alignSelf: 'center', 19 | color: '#007aff', 20 | fontSize: 16, 21 | fontWeight: '600', //boldness 22 | paddingTop: 10, 23 | paddingBottom: 10 24 | }, 25 | buttonStyle: { 26 | flex: 1, 27 | alignSelf: 'stretch', 28 | //strech to fill the limit of the container 29 | backgroundColor: '#fff', 30 | borderRadius: 5, 31 | borderWidth: 1, 32 | borderColor: '#007aff', 33 | marginLeft: 5, 34 | marginRight: 5 35 | } 36 | }; 37 | 38 | export { Button }; 39 | -------------------------------------------------------------------------------- /System_Equation_New/src/Appp.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import firebase from 'firebase'; 3 | import { View } from 'react-native'; 4 | import { Provider } from 'react-redux'; 5 | import { createStore, applyMiddleware } from 'redux'; 6 | import reducers from './reducers'; 7 | import ReduxThunk from 'redux-thunk'; 8 | import Router from './Router'; 9 | 10 | class Appp extends Component { 11 | componentWillMount() { 12 | const config = { 13 | apiKey: 'AIzaSyDpCyQI7xNXJeroXkS2PV5dANQIofJGZPw', 14 | authDomain: 'system-equation-solver.firebaseapp.com', 15 | databaseURL: 'https://system-equation-solver.firebaseio.com', 16 | projectId: 'system-equation-solver', 17 | storageBucket: 'system-equation-solver.appspot.com', 18 | messagingSenderId: '655886686459' 19 | }; 20 | firebase.initializeApp(config); 21 | } 22 | render() { 23 | const store = createStore(reducers, {}, applyMiddleware(ReduxThunk)); 24 | 25 | return ( 26 | 27 | 28 | 29 | 30 | 31 | ); 32 | } 33 | }; 34 | 35 | export default Appp; 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Wenhao Geng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/common/Input.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { TextInput, View, Text } from 'react-native'; 3 | 4 | const Input = ({ label, value, onChangeText, placeHolder, secureTextEntry }) => { 5 | //receiving prop 6 | const { inputStyle, labelStyle, containerStyle } = styles; 7 | 8 | return ( 9 | 10 | {label} 11 | 19 | 20 | ); 21 | }; 22 | 23 | const styles = { 24 | inputStyle: { 25 | color: '#000', 26 | paddingRight: 5, 27 | paddingLeft: 5, 28 | fontSize: 18, 29 | lineHeight: 23, 30 | flex: 2 31 | }, 32 | labelStyle: { 33 | fontSize: 18, 34 | paddingLeft: 20, 35 | flex: 1 36 | }, 37 | /*Here since Text(style with inputStyle) and TextInput (style with labelStyle) 38 | are children of , flex will define how much portion they want to share*/ 39 | containerStyle: { 40 | height: 40, 41 | flex: 1, 42 | flexDirection: 'row', 43 | alignItems: 'center' 44 | } 45 | //container here refers to 46 | }; 47 | 48 | export { Input }; 49 | -------------------------------------------------------------------------------- /System_Equation_New/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "System_Equation_New", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "eslint": "^5.4.0", 7 | "eslint-config-airbnb": "^17.1.0", 8 | "eslint-plugin-import": "^2.14.0", 9 | "eslint-plugin-jsx-a11y": "^6.1.1", 10 | "eslint-plugin-react": "^7.11.1", 11 | "jest-expo": "~27.0.0", 12 | "react-native-scripts": "1.14.0", 13 | "react-test-renderer": "16.3.1" 14 | }, 15 | "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js", 16 | "scripts": { 17 | "start": "react-native-scripts start", 18 | "eject": "react-native-scripts eject", 19 | "android": "react-native-scripts android", 20 | "ios": "react-native-scripts ios", 21 | "test": "jest" 22 | }, 23 | "jest": { 24 | "preset": "jest-expo" 25 | }, 26 | "dependencies": { 27 | "expo": "^27.0.1", 28 | "firebase": "^5.1.0", 29 | "lodash": "^4.17.10", 30 | "native-base": "^2.8.1", 31 | "react": "16.3.1", 32 | "react-native": "~0.55.2", 33 | "react-native-custom-keyboard": "^1.0.4", 34 | "react-native-elements": "^0.19.1", 35 | "react-native-router-flux": "^3.43.0", 36 | "react-native-swiper": "^1.5.14", 37 | "react-redux": "^5.0.7", 38 | "redux": "^4.0.0", 39 | "redux-thunk": "^2.3.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /System_Equation_New/src/components/GreetingPage.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { View, Text } from 'react-native'; 3 | import { FormInput, Button } from 'react-native-elements'; 4 | import { Actions } from '../../node_modules/react-native-router-flux'; 5 | 6 | class GreetingPage extends Component { 7 | state = { 8 | name: '' 9 | }; 10 | 11 | onNameChange = (text) => { 12 | this.setState({ 13 | name: text 14 | }); 15 | } 16 | 17 | render() { 18 | return ( 19 | 27 | 34 | Hi, how can I call you? 35 | 36 | 45 |