├── .babelrc ├── .flowconfig ├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── libraries │ ├── 0_46_4.xml │ ├── Branch_2_6_1.xml │ ├── Branch_2_6_11.xml │ ├── annotations.xml │ ├── annotations1.xml │ ├── annotations10.xml │ ├── annotations11.xml │ ├── annotations12.xml │ ├── annotations13.xml │ ├── annotations14.xml │ ├── annotations15.xml │ ├── annotations16.xml │ ├── annotations17.xml │ ├── annotations18.xml │ ├── annotations19.xml │ ├── annotations2.xml │ ├── annotations20.xml │ ├── annotations21.xml │ ├── annotations3.xml │ ├── annotations4.xml │ ├── annotations5.xml │ ├── annotations6.xml │ ├── annotations7.xml │ ├── annotations8.xml │ ├── annotations9.xml │ ├── buck_android_support.xml │ ├── classes.xml │ ├── classes1.xml │ ├── classes10.xml │ ├── classes11.xml │ ├── classes12.xml │ ├── classes13.xml │ ├── classes14.xml │ ├── classes15.xml │ ├── classes16.xml │ ├── classes17.xml │ ├── classes18.xml │ ├── classes19.xml │ ├── classes2.xml │ ├── classes20.xml │ ├── classes21.xml │ ├── classes22.xml │ ├── classes23.xml │ ├── classes24.xml │ ├── classes25.xml │ ├── classes26.xml │ ├── classes27.xml │ ├── classes28.xml │ ├── classes29.xml │ ├── classes3.xml │ ├── classes30.xml │ ├── classes31.xml │ ├── classes32.xml │ ├── classes33.xml │ ├── classes34.xml │ ├── classes35.xml │ ├── classes36.xml │ ├── classes37.xml │ ├── classes38.xml │ ├── classes39.xml │ ├── classes4.xml │ ├── classes40.xml │ ├── classes41.xml │ ├── classes42.xml │ ├── classes43.xml │ ├── classes44.xml │ ├── classes45.xml │ ├── classes46.xml │ ├── classes47.xml │ ├── classes48.xml │ ├── classes49.xml │ ├── classes5.xml │ ├── classes50.xml │ ├── classes51.xml │ ├── classes52.xml │ ├── classes53.xml │ ├── classes54.xml │ ├── classes55.xml │ ├── classes56.xml │ ├── classes57.xml │ ├── classes58.xml │ ├── classes59.xml │ ├── classes6.xml │ ├── classes60.xml │ ├── classes61.xml │ ├── classes62.xml │ ├── classes63.xml │ ├── classes64.xml │ ├── classes65.xml │ ├── classes66.xml │ ├── classes67.xml │ ├── classes68.xml │ ├── classes69.xml │ ├── classes7.xml │ ├── classes70.xml │ ├── classes71.xml │ ├── classes72.xml │ ├── classes73.xml │ ├── classes74.xml │ ├── classes75.xml │ ├── classes76.xml │ ├── classes77.xml │ ├── classes8.xml │ ├── classes9.xml │ ├── gradle_wrapper.xml │ ├── gradle_wrapper1.xml │ ├── gradle_wrapper2.xml │ ├── gradle_wrapper3.xml │ ├── gradle_wrapper4.xml │ ├── infer_annotations_1_5.xml │ ├── infer_annotations_1_51.xml │ ├── infer_annotations_1_52.xml │ ├── infer_annotations_1_53.xml │ ├── infer_annotations_1_54.xml │ ├── infer_annotations_4_0.xml │ ├── internal_impl_23_0_1.xml │ ├── internal_impl_23_0_11.xml │ ├── internal_impl_23_4_0.xml │ ├── internal_impl_24_0_0.xml │ ├── internal_impl_25_0_1.xml │ ├── internal_impl_25_0_11.xml │ ├── internal_impl_25_0_12.xml │ ├── internal_impl_25_0_13.xml │ ├── internal_impl_25_0_14.xml │ ├── libs.xml │ ├── libs1.xml │ ├── main.xml │ ├── mockable_android_23.xml │ └── mockable_android_25.xml ├── misc.xml ├── modules.xml └── workspace.xml ├── .watchmanconfig ├── App.js ├── README.md ├── Team Contract ├── app.json ├── app ├── .DS_Store ├── components │ ├── AllQuestions.js │ ├── Buttons │ │ ├── ActionButton.js │ │ ├── ArrayButton.js │ │ ├── ConditionalButton.js │ │ ├── LoopsButton.js │ │ ├── NumsLetters.js │ │ ├── OperatorButton.js │ │ ├── SpacingButton.js │ │ ├── StringButton.js │ │ └── VariableButton.js │ ├── ClipButtons.js │ ├── CodeHeader.js │ ├── Editor │ │ ├── BasicKeyboard.js │ │ ├── KeyBoard.js │ │ ├── NewCodeEnv.js │ │ ├── NewSwitchView.js │ │ ├── SwitchView.js │ │ └── TextIDE.js │ ├── Header.js │ ├── Home.js │ ├── SingleQuestion.js │ ├── TestEnv.js │ └── img │ │ ├── front-page.png │ │ ├── fs-logo.png │ │ ├── fullstack.png │ │ └── loading.gif └── webviewScripts │ └── load.html ├── codeTapSplash.png ├── package-lock.json ├── package.json ├── tests ├── __snapshots__ │ └── components.test.js.snap └── components.test.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-expo"] 3 | } 4 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 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 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | ; Additional create-react-native-app ignores 18 | 19 | ; Ignore duplicate module providers 20 | .*/node_modules/fbemitter/lib/* 21 | 22 | ; Ignore misbehaving dev-dependencies 23 | .*/node_modules/xdl/build/* 24 | .*/node_modules/reqwest/tests/* 25 | 26 | ; Ignore missing expo-sdk dependencies (temporarily) 27 | ; https://github.com/expo/expo/issues/162 28 | .*/node_modules/expo/src/* 29 | 30 | ; Ignore react-native-fbads dependency of the expo sdk 31 | .*/node_modules/react-native-fbads/* 32 | 33 | [include] 34 | 35 | [libs] 36 | node_modules/react-native/Libraries/react-native/react-native-interface.js 37 | node_modules/react-native/flow 38 | flow/ 39 | 40 | [options] 41 | module.system=haste 42 | 43 | emoji=true 44 | 45 | experimental.strict_type_args=true 46 | 47 | munge_underscores=true 48 | 49 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 50 | 51 | suppress_type=$FlowIssue 52 | suppress_type=$FlowFixMe 53 | suppress_type=$FixMe 54 | 55 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\) 56 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+ 57 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 58 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 59 | 60 | unsafe.enable_getters_and_setters=true 61 | 62 | [version] 63 | ^0.47.0 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | npm-debug.* 4 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/libraries/0_46_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/Branch_2_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Branch_2_6_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations20.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations21.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/annotations9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/buck_android_support.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes20.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes21.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes27.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes28.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes30.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes31.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes33.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes34.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes35.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes36.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes37.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes38.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes39.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes40.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes41.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes42.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes43.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes44.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes45.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes46.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes47.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes48.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes49.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes50.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes51.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes52.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes53.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes54.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes55.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes56.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes57.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes58.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes60.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes61.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes62.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes63.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes64.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes65.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes66.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes67.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes68.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes69.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes70.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes71.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes72.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes73.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes74.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes75.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes76.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes77.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/classes9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/gradle_wrapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/gradle_wrapper1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/gradle_wrapper2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/gradle_wrapper3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/gradle_wrapper4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/infer_annotations_1_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/infer_annotations_1_51.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/infer_annotations_1_52.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/infer_annotations_1_53.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/infer_annotations_1_54.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/infer_annotations_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_23_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_23_0_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_24_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_25_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_25_0_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_25_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_25_0_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/internal_impl_25_0_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/libs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/libs1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/mockable_android_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/mockable_android_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 1.8 21 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 93 | 94 | 101 | 102 | 103 | 104 | 122 | 129 | 130 | 138 | 139 | 144 | 145 | 147 | 148 | 149 | 151 | 152 | 153 | 154 | 1502508770752 155 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 195 | 198 | 199 | 200 | 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Navigator } from 'react-native-deprecated-custom-components'; 3 | 4 | import HomeComponent from './app/components/Home'; 5 | import AllQuestions from './app/components/AllQuestions'; 6 | import SingleQuestion from './app/components/SingleQuestion'; 7 | import CodeEnv from './app/components/Editor/NewCodeEnv'; 8 | import TestEnv from './app/components/TestEnv'; 9 | 10 | // toggles yellow warnning box for demo purposes 11 | // console.disableYellowBox = true; 12 | 13 | export default class App extends React.Component { 14 | 15 | renderScene(route, navigator) { 16 | 17 | switch (route.id) { 18 | 19 | case 'homecomponent': 20 | return (); 21 | 22 | case 'all-questions-component': 23 | return (); 24 | 25 | case 'single-question-component': 26 | return (); 27 | 28 | case 'Code-Env': 29 | return (); 30 | 31 | case 'back-code-env': 32 | return (); 33 | 34 | case 'test-env': 35 | return (); 36 | 37 | default: 38 | return (); 39 | } 40 | } 41 | 42 | render() { 43 | return ( 44 | Navigator.SceneConfigs.FloatFromLeft} /> 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##CodeTap 2 | 3 | ![Splash Page Image](codeTapSplash.png) 4 | 5 | This project was bootstrapped with [Create React Native App](https://github.com/react-community/create-react-native-app). 6 | 7 | Below you'll find information about performing common tasks. The most recent version of this guide is available [here](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md). 8 | 9 | ## Table of Contents 10 | 11 | * [Updating to New Releases](#updating-to-new-releases) 12 | * [Available Scripts](#available-scripts) 13 | * [npm start](#npm-start) 14 | * [npm test](#npm-test) 15 | * [npm run ios](#npm-run-ios) 16 | * [npm run android](#npm-run-android) 17 | * [npm run eject](#npm-run-eject) 18 | * [Writing and Running Tests](#writing-and-running-tests) 19 | * [Environment Variables](#environment-variables) 20 | * [Configuring Packager IP Address](#configuring-packager-ip-address) 21 | * [Adding Flow](#adding-flow) 22 | * [Customizing App Display Name and Icon](#customizing-app-display-name-and-icon) 23 | * [Sharing and Deployment](#sharing-and-deployment) 24 | * [Publishing to Expo's React Native Community](#publishing-to-expos-react-native-community) 25 | * [Building an Expo "standalone" app](#building-an-expo-standalone-app) 26 | * [Ejecting from Create React Native App](#ejecting-from-create-react-native-app) 27 | * [Build Dependencies (Xcode & Android Studio)](#build-dependencies-xcode-android-studio) 28 | * [Should I Use ExpoKit?](#should-i-use-expokit) 29 | * [Troubleshooting](#troubleshooting) 30 | * [Networking](#networking) 31 | * [iOS Simulator won't open](#ios-simulator-wont-open) 32 | * [QR Code does not scan](#qr-code-does-not-scan) 33 | 34 | ## Updating to New Releases 35 | 36 | You should only need to update the global installation of `create-react-native-app` very rarely, ideally never. 37 | 38 | Updating the `react-native-scripts` dependency of your app should be as simple as bumping the version number in `package.json` and reinstalling your project's dependencies. 39 | 40 | Upgrading to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions, and setting the correct `sdkVersion` in `app.json`. See the [versioning guide](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) for up-to-date information about package version compatibility. 41 | 42 | ## Available Scripts 43 | 44 | If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing. 45 | 46 | ### `npm start` 47 | 48 | Runs your app in development mode. 49 | 50 | Open it in the [Expo app](https://expo.io) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal. 51 | 52 | Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the `--reset-cache` flag to the start script: 53 | 54 | ``` 55 | npm start -- --reset-cache 56 | # or 57 | yarn start -- --reset-cache 58 | ``` 59 | 60 | #### `npm test` 61 | 62 | Runs the [jest](https://github.com/facebook/jest) test runner on your tests. 63 | 64 | #### `npm run ios` 65 | 66 | Like `npm start`, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed. 67 | 68 | #### `npm run android` 69 | 70 | Like `npm start`, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see [React Native docs](https://facebook.github.io/react-native/docs/getting-started.html) for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of `adb` available to Create React Native App: 71 | 72 | ##### Using Android Studio's `adb` 73 | 74 | 1. Make sure that you can run adb from your terminal. 75 | 2. Open Genymotion and navigate to `Settings -> ADB`. Select “Use custom Android SDK tools” and update with your [Android SDK directory](https://stackoverflow.com/questions/25176594/android-sdk-location). 76 | 77 | ##### Using Genymotion's `adb` 78 | 79 | 1. Find Genymotion’s copy of adb. On macOS for example, this is normally `/Applications/Genymotion.app/Contents/MacOS/tools/`. 80 | 2. Add the Genymotion tools directory to your path (instructions for [Mac](http://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/), [Linux](http://www.computerhope.com/issues/ch001647.htm), and [Windows](https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/)). 81 | 3. Make sure that you can run adb from your terminal. 82 | 83 | #### `npm run eject` 84 | 85 | This will start the process of "ejecting" from Create React Native App's build scripts. You'll be asked a couple of questions about how you'd like to build your project. 86 | 87 | **Warning:** Running eject is a permanent action (aside from whatever version control system you use). An ejected app will require you to have an [Xcode and/or Android Studio environment](https://facebook.github.io/react-native/docs/getting-started.html) set up. 88 | 89 | ## Customizing App Display Name and Icon 90 | 91 | You can edit `app.json` to include [configuration keys](https://docs.expo.io/versions/latest/guides/configuration.html) under the `expo` key. 92 | 93 | To change your app's display name, set the `expo.name` key in `app.json` to an appropriate string. 94 | 95 | To set an app icon, set the `expo.icon` key in `app.json` to be either a local path or a URL. It's recommended that you use a 512x512 png file with transparency. 96 | 97 | ## Writing and Running Tests 98 | 99 | This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test` extension to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/App.test.js) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/tutorial-react-native.html). 100 | 101 | ## Environment Variables 102 | 103 | You can configure some of Create React Native App's behavior using environment variables. 104 | 105 | ### Configuring Packager IP Address 106 | 107 | When starting your project, you'll see something like this for your project URL: 108 | 109 | ``` 110 | exp://192.168.0.2:19000 111 | ``` 112 | 113 | The "manifest" at that URL tells the Expo app how to retrieve and load your app's JavaScript bundle, so even if you load it in the app via a URL like `exp://localhost:19000`, the Expo client app will still try to retrieve your app at the IP address that the start script provides. 114 | 115 | In some cases, this is less than ideal. This might be the case if you need to run your project inside of a virtual machine and you have to access the packager via a different IP address than the one which prints by default. In order to override the IP address or hostname that is detected by Create React Native App, you can specify your own hostname via the `REACT_NATIVE_PACKAGER_HOSTNAME` environment variable: 116 | 117 | Mac and Linux: 118 | 119 | ``` 120 | REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' npm start 121 | ``` 122 | 123 | Windows: 124 | ``` 125 | set REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' 126 | npm start 127 | ``` 128 | 129 | The above example would cause the development server to listen on `exp://my-custom-ip-address-or-hostname:19000`. 130 | 131 | ## Adding Flow 132 | 133 | Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept. 134 | 135 | React Native works with [Flow](http://flowtype.org/) out of the box, as long as your Flow version matches the one used in the version of React Native. 136 | 137 | To add a local dependency to the correct Flow version to a Create React Native App project, follow these steps: 138 | 139 | 1. Find the Flow `[version]` at the bottom of the included [.flowconfig](.flowconfig) 140 | 2. Run `npm install --save-dev flow-bin@x.y.z` (or `yarn add --dev flow-bin@x.y.z`), where `x.y.z` is the .flowconfig version number. 141 | 3. Add `"flow": "flow"` to the `scripts` section of your `package.json`. 142 | 4. Add `// @flow` to any files you want to type check (for example, to `App.js`). 143 | 144 | Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors. 145 | You can optionally use a [plugin for your IDE or editor](https://flow.org/en/docs/editors/) for a better integrated experience. 146 | 147 | To learn more about Flow, check out [its documentation](https://flow.org/). 148 | 149 | ## Sharing and Deployment 150 | 151 | Create React Native App does a lot of work to make app setup and development simple and straightforward, but it's very difficult to do the same for deploying to Apple's App Store or Google's Play Store without relying on a hosted service. 152 | 153 | ### Publishing to Expo's React Native Community 154 | 155 | Expo provides free hosting for the JS-only apps created by CRNA, allowing you to share your app through the Expo client app. This requires registration for an Expo account. 156 | 157 | Install the `exp` command-line tool, and run the publish command: 158 | 159 | ``` 160 | $ npm i -g exp 161 | $ exp publish 162 | ``` 163 | 164 | ### Building an Expo "standalone" app 165 | 166 | You can also use a service like [Expo's standalone builds](https://docs.expo.io/versions/latest/guides/building-standalone-apps.html) if you want to get an IPA/APK for distribution without having to build the native code yourself. 167 | 168 | ### Ejecting from Create React Native App 169 | 170 | If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio. 171 | 172 | This is usually as simple as running `npm run eject` in your project, which will walk you through the process. Make sure to install `react-native-cli` and follow the [native code getting started guide for React Native](https://facebook.github.io/react-native/docs/getting-started.html). 173 | 174 | #### Should I Use ExpoKit? 175 | 176 | If you have made use of Expo APIs while working on your project, then those API calls will stop working if you eject to a regular React Native project. If you want to continue using those APIs, you can eject to "React Native + ExpoKit" which will still allow you to build your own native code and continue using the Expo APIs. See the [ejecting guide](https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md) for more details about this option. 177 | 178 | ## Troubleshooting 179 | 180 | ### Networking 181 | 182 | If you're unable to load your app on your phone due to a network timeout or a refused connection, a good first step is to verify that your phone and computer are on the same network and that they can reach each other. Create React Native App needs access to ports 19000 and 19001 so ensure that your network and firewall settings allow access from your device to your computer on both of these ports. 183 | 184 | Try opening a web browser on your phone and opening the URL that the packager script prints, replacing `exp://` with `http://`. So, for example, if underneath the QR code in your terminal you see: 185 | 186 | ``` 187 | exp://192.168.0.1:19000 188 | ``` 189 | 190 | Try opening Safari or Chrome on your phone and loading 191 | 192 | ``` 193 | http://192.168.0.1:19000 194 | ``` 195 | 196 | and 197 | 198 | ``` 199 | http://192.168.0.1:19001 200 | ``` 201 | 202 | If this works, but you're still unable to load your app by scanning the QR code, please open an issue on the [Create React Native App repository](https://github.com/react-community/create-react-native-app) with details about these steps and any other error messages you may have received. 203 | 204 | If you're not able to load the `http` URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager. 205 | 206 | ### iOS Simulator won't open 207 | 208 | If you're on a Mac, there are a few errors that users sometimes see when attempting to `npm run ios`: 209 | 210 | * "non-zero exit code: 107" 211 | * "You may need to install Xcode" but it is already installed 212 | * and others 213 | 214 | There are a few steps you may want to take to troubleshoot these kinds of errors: 215 | 216 | 1. Make sure Xcode is installed and open it to accept the license agreement if it prompts you. You can install it from the Mac App Store. 217 | 2. Open Xcode's Preferences, the Locations tab, and make sure that the `Command Line Tools` menu option is set to something. Sometimes when the CLI tools are first installed by Homebrew this option is left blank, which can prevent Apple utilities from finding the simulator. Make sure to re-run `npm/yarn run ios` after doing so. 218 | 3. If that doesn't work, open the Simulator, and under the app menu select `Reset Contents and Settings...`. After that has finished, quit the Simulator, and re-run `npm/yarn run ios`. 219 | 220 | ### QR Code does not scan 221 | 222 | If you're not able to scan the QR code, make sure your phone's camera is focusing correctly, and also make sure that the contrast on the two colors in your terminal is high enough. For example, WebStorm's default themes may [not have enough contrast](https://github.com/react-community/create-react-native-app/issues/49) for terminal QR codes to be scannable with the system barcode scanners that the Expo app uses. 223 | 224 | If this causes problems for you, you may want to try changing your terminal's color theme to have more contrast, or running Create React Native App from a different terminal. You can also manually enter the URL printed by the packager script in the Expo app's search bar to load it manually. 225 | -------------------------------------------------------------------------------- /Team Contract: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/Team Contract -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "CodeTap", 4 | "slug": "code-tap", 5 | "sdkVersion": "36.0.0", 6 | "privacy": "public", 7 | "version": "0.1.0", 8 | "platforms": [ 9 | "android", 10 | "ios" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/app/.DS_Store -------------------------------------------------------------------------------- /app/components/AllQuestions.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet, TouchableOpacity, AsyncStorage } from 'react-native'; 3 | import { Container, View, DeckSwiper, Card, CardItem, Thumbnail, Text, Left, Body, Icon } from 'native-base'; 4 | import NetInfo from "@react-native-community/netinfo" 5 | 6 | import HeaderComponent from './Header.js' 7 | 8 | console.log(NetInfo) 9 | const cards = [ 10 | { 11 | id: 'single-question-component', 12 | title: 'String Search', 13 | tests: [ 14 | { 15 | inputs: ['or', 'hello world'], 16 | output: [true] 17 | }, { 18 | inputs: ['he', 'hello'], 19 | output: [true] 20 | }, { 21 | inputs: ['wet', 'youse sir'], 22 | output: [false] 23 | } 24 | ], 25 | boilerPlate: 'function indexOf (needle, haystack){\n\t\n}', 26 | description: 'You are attempting to test if the appearance of one string (the needle) is inside of another (the haystack).', 27 | image: require('./img/fullstack.png'), 28 | difficulty: 'Medium', 29 | likes: 0 30 | }, { 31 | id: 'single-question-component', 32 | title: 'Reverse Array', 33 | tests: [ 34 | { 35 | inputs: [[1, 2, 3, 4]], 36 | output: [[4, 3, 2, 1]] 37 | } 38 | ], 39 | boilerPlate: 'function reverseArray(arr){\n\t\n}', 40 | description: 'Write a function reverseArray that reverses the elements of an array and returns the reversed array.', 41 | image: require('./img/fullstack.png'), 42 | difficulty: 'Medium', 43 | likes: 0 44 | }, 45 | { 46 | id: 'single-question-component', 47 | title: 'Sum', 48 | tests: [ 49 | { 50 | inputs: [4, 5], 51 | output: [9] 52 | }, { 53 | inputs: [0, 10], 54 | output: [10] 55 | }, { 56 | inputs: [24, 2], 57 | output: [26] 58 | } 59 | ], 60 | boilerPlate: 'function sum(a,b){\n\t\n}', 61 | description: 'Write a function Sum that adds two numbers together', 62 | image: require('./img/fullstack.png'), 63 | difficulty: 'Easy', 64 | likes: 0 65 | }, 66 | ]; 67 | 68 | export default class AllQuestions extends Component { 69 | constructor(props) { 70 | super(props); 71 | this.state = { 72 | isOnline: false, 73 | initializeCards: false, 74 | myQuestions: cards, 75 | onlineQuestions: [{}], // fetched from server 76 | } 77 | this.onQuestionPress = this.onQuestionPress.bind(this); 78 | 79 | //Sets the state based on connectivity 80 | //Initializes the myQuestions state 81 | 82 | // **** android fix 83 | NetInfo.isConnected.fetch().then(isConnected => { 84 | console.log('First, is ' + (isConnected ? 'online' : 'offline')); 85 | 86 | //The below is for Android Fix 87 | // this.setState({ 88 | // isOnline: isConnected 89 | // }, () => { 90 | // this.intializeComponent(); 91 | // }) 92 | }) 93 | 94 | const handleFirstConnectivityChange = (isConnected) => { 95 | console.log('Then, is ' + (isConnected ? 'online' : 'offline')); 96 | NetInfo.isConnected.removeEventListener( 97 | 'change', 98 | handleFirstConnectivityChange 99 | ); 100 | // const result = this.state.isOnline === isConnected ? null : this.setState({ isOnline: isConnected }); 101 | if (this.state.isOnline !== isConnected) { 102 | this.setState({ isOnline: isConnected }) 103 | } 104 | this.intializeComponent(); 105 | } 106 | NetInfo.isConnected.addEventListener( 107 | 'change', 108 | handleFirstConnectivityChange 109 | ); 110 | } 111 | 112 | //Populates state.myQuestions based connectivity 113 | intializeComponent() { 114 | if (this.state.isOnline) { 115 | fetch('https://codetap.herokuapp.com/api/questions') 116 | .then(res => res.json()) 117 | .then(resJson => { 118 | return AsyncStorage.setItem('myQuestions', JSON.stringify(resJson)) 119 | }) 120 | .then(() => { 121 | AsyncStorage.getItem('myQuestions') 122 | .then((value) => { 123 | var result = JSON.parse(value).reduce((prev, curr) => { 124 | return prev.concat(curr) 125 | }, []); 126 | this.setState( 127 | { 128 | myQuestions: this.state.myQuestions.concat(result), 129 | initializeCards: true 130 | }) 131 | }) 132 | }) 133 | } else { 134 | //Used to clear local storage 135 | // AsyncStorage.setItem('myQuestions', JSON.stringify([])) 136 | 137 | AsyncStorage.getItem('myQuestions') 138 | .then((value) => { 139 | var result = JSON.parse(value).reduce((prev, curr) => { 140 | return prev.concat(curr) 141 | }, []); 142 | this.setState( 143 | { 144 | myQuestions: this.state.myQuestions.concat(result), 145 | initializeCards: true 146 | }) 147 | }) 148 | } 149 | } 150 | 151 | onQuestionPress(question) { 152 | this.props.navigator.push({ id: 'single-question-component', question: question }) 153 | } 154 | render() { 155 | 156 | return ( 157 | 158 | 159 | 160 | 163 | Status: {this.state.isOnline ? 'Online' : 'Offline'} 169 | Click to Select a Question 176 | {/* DeckSwiper can only render dataSource once 177 | Boolean ensures that Questions are initialized beforehand */} 178 | {Boolean(this.state.initializeCards) && { 181 | this.onQuestionPress(item) 182 | }}> 183 | 187 | 190 | 191 | 192 | 193 | {item.title} 194 | {item.difficulty} 197 | 198 | 199 | 200 | 210 | {item.description} 211 | 212 | 215 | 218 | {item.likes} 221 | 222 | 223 | } /> 224 | } 225 | 226 | 231 | {`<-- Swipe Left and Right for Questions -->`} 236 | 237 | 238 | ); 239 | } 240 | } 241 | 242 | const styles = StyleSheet.create({ 243 | container: { 244 | backgroundColor: '#333333' 245 | } 246 | }) 247 | -------------------------------------------------------------------------------- /app/components/Buttons/ActionButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | export default class ActionButton extends Component { 5 | constructor(props) { 6 | super(props); 7 | this.state = { 8 | ActionKeys: [ 9 | { title: 'return', output: 'return ' }, 10 | { title: 'continue', output: 'continue;' }, 11 | { title: 'break', output: 'break;' }, 12 | ], 13 | }; 14 | } 15 | 16 | render() { 17 | return ( 18 | 19 | {this.state.ActionKeys.map((key) => { 20 | return ( 21 | ); 34 | }) 35 | } 36 | 37 | 43 | 44 | 45 | ); 46 | } 47 | } 48 | 49 | const styles = StyleSheet.create({ 50 | container: { 51 | flexWrap: 'wrap', 52 | marginTop: 50, 53 | padding: 4, 54 | flexDirection: 'row', 55 | justifyContent: 'center' 56 | }, 57 | smallContainer: { 58 | minWidth: 400, 59 | flexWrap: 'wrap', 60 | padding: 4, 61 | flexDirection: 'row', 62 | justifyContent: 'center' 63 | }, 64 | hotKey: { 65 | justifyContent: 'center', 66 | alignItems: 'center', 67 | padding: 10, 68 | marginTop: 3, 69 | marginLeft: 1, 70 | marginRight: 1, 71 | marginBottom: 5, 72 | backgroundColor: '#999999' 73 | }, 74 | backKey: { 75 | justifyContent: 'center', 76 | alignItems: 'center', 77 | width: 100, 78 | borderColor: '#666666', 79 | backgroundColor: 'transparent', 80 | padding: 10, 81 | marginTop: 5, 82 | marginBottom: 5, 83 | borderWidth: 1 84 | } 85 | }); 86 | -------------------------------------------------------------------------------- /app/components/Buttons/ArrayButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class ArrayButton extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | ArrayKeys: [ 10 | { title: 'length', output: '.length' }, 11 | { title: 'slice', output: '.slice()' }, 12 | { title: 'splice', output: '.splice()' }, 13 | { title: 'pop', output: '.pop()' }, 14 | { title: 'push', output: '.push()' }, 15 | { title: 'shift', output: '.shift()' }, 16 | { title: 'unshift', output: '.unshift()' }, 17 | { title: 'sort', output: '.sort()' }, 18 | { title: 'join', output: '.join()' }, 19 | { title: 'concat', output: '.concat()' }, 20 | { title: 'map', output: '.map( () => {\n\t\n})' }, 21 | { title: 'filter', output: '.filter( () => {\n\t\n\t})' }, 22 | { title: 'reduce', output: '.reduce( () => {\n\t\n\t})' }, 23 | { title: 'forEach', output: '.forEach( () => {\n\t\n\t})' }, 24 | { title: 'indexOf', output: '.indexOf()' } 25 | ], 26 | }; 27 | } 28 | 29 | render() { 30 | return ( 31 | 32 | {this.state.ArrayKeys.map((key) => { 33 | return ( 34 | ); 47 | }) 48 | } 49 | 50 | 56 | 57 | 58 | ); 59 | } 60 | } 61 | 62 | const styles = StyleSheet.create({ 63 | container: { 64 | flexWrap: 'wrap', 65 | marginTop: 50, 66 | padding: 4, 67 | flexDirection: 'row', 68 | justifyContent: 'center' 69 | }, 70 | smallContainer: { 71 | minWidth: 400, 72 | flexWrap: 'wrap', 73 | padding: 4, 74 | flexDirection: 'row', 75 | justifyContent: 'center' 76 | }, 77 | hotKey: { 78 | justifyContent: 'center', 79 | alignItems: 'center', 80 | padding: 10, 81 | marginTop: 3, 82 | marginLeft: 1, 83 | marginRight: 1, 84 | marginBottom: 5, 85 | backgroundColor: '#999999' 86 | }, 87 | backKey: { 88 | justifyContent: 'center', 89 | alignItems: 'center', 90 | width: 100, 91 | borderColor: '#666666', 92 | backgroundColor: 'transparent', 93 | padding: 10, 94 | marginTop: 5, 95 | marginBottom: 5, 96 | borderWidth: 1 97 | } 98 | }); 99 | -------------------------------------------------------------------------------- /app/components/Buttons/ConditionalButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | 6 | export default class ConditionalButton extends Component { 7 | constructor(props) { 8 | super(props); 9 | this.state = { 10 | ConditionalKeys: [ 11 | { title: 'if', output: 'if( ){\n\t\n\t}' }, 12 | { title: 'else if', output: 'else if( ){\n\t\n\t}' }, 13 | { title: 'else', output: 'else {\n\t\n\t}' } 14 | ], 15 | }; 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | {this.state.ConditionalKeys.map((key) => { 22 | return ( 23 | ); 35 | }) 36 | } 37 | 38 | 43 | 44 | 45 | ); 46 | } 47 | } 48 | 49 | const styles = StyleSheet.create({ 50 | container: { 51 | flexWrap: 'wrap', 52 | marginTop: 50, 53 | padding: 4, 54 | flexDirection: 'row', 55 | justifyContent: 'center' 56 | }, 57 | smallContainer: { 58 | minWidth: 400, 59 | flexWrap: 'wrap', 60 | padding: 4, 61 | flexDirection: 'row', 62 | justifyContent: 'center' 63 | }, 64 | hotKey: { 65 | justifyContent: 'center', 66 | alignItems: 'center', 67 | padding: 10, 68 | marginTop: 3, 69 | marginLeft: 1, 70 | marginRight: 1, 71 | marginBottom: 5, 72 | backgroundColor: '#999999' 73 | }, 74 | backKey: { 75 | justifyContent: 'center', 76 | alignItems: 'center', 77 | width: 100, 78 | borderColor: '#666666', 79 | backgroundColor: 'transparent', 80 | padding: 10, 81 | marginTop: 5, 82 | marginBottom: 5, 83 | borderWidth: 1 84 | } 85 | }); 86 | -------------------------------------------------------------------------------- /app/components/Buttons/LoopsButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class LoopButton extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | LoopKeys: [ 10 | { title: 'for', output: 'for(let i=0; ;i++){\n\t\n\t}' }, 11 | { title: 'for in', output: 'for(let key in ){\n\t\n\t}' }, 12 | { title: 'while', output: 'while(){\n\t\n\t}' } 13 | ], 14 | }; 15 | } 16 | 17 | render() { 18 | return ( 19 | 20 | {this.state.LoopKeys.map((key) => { 21 | return ( 22 | ); 34 | }) 35 | } 36 | 37 | 42 | 43 | 44 | ); 45 | } 46 | } 47 | 48 | const styles = StyleSheet.create({ 49 | container: { 50 | flexWrap: 'wrap', 51 | marginTop: 50, 52 | padding: 4, 53 | flexDirection: 'row', 54 | justifyContent: 'center' 55 | }, 56 | smallContainer: { 57 | minWidth: 400, 58 | flexWrap: 'wrap', 59 | padding: 4, 60 | flexDirection: 'row', 61 | justifyContent: 'center' 62 | }, 63 | hotKey: { 64 | justifyContent: 'center', 65 | alignItems: 'center', 66 | padding: 10, 67 | marginTop: 3, 68 | marginLeft: 1, 69 | marginRight: 1, 70 | marginBottom: 5, 71 | backgroundColor: '#999999' 72 | }, 73 | backKey: { 74 | justifyContent: 'center', 75 | alignItems: 'center', 76 | width: 100, 77 | borderColor: '#666666', 78 | backgroundColor: 'transparent', 79 | padding: 10, 80 | marginTop: 5, 81 | marginBottom: 5, 82 | borderWidth: 1 83 | } 84 | }); 85 | -------------------------------------------------------------------------------- /app/components/Buttons/NumsLetters.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { TouchableOpacity, StyleSheet } from 'react-native'; 3 | import { View, Text } from 'native-base'; 4 | 5 | export default ({ edit, shiftLeft, shiftRight, del, space, capslock, caps, symslock, syms }) => { 6 | const nums = '1234567890'.split(''); 7 | const topRow = 'qwertyuiop'.split(''); 8 | const middleRow = 'asdfghjkl'.split(''); 9 | const bottomRow = 'zxcvbnm'.split(''); 10 | 11 | const symTr = '#%^*+-=/"<>'.split(''); 12 | const symMr = ":;()$&@_\|~".split(''); 13 | const symBr = ".,?!'[]{}".split(''); 14 | 15 | // const mathTr= "[]{}#%^*+=".split(''); 16 | // const mathMr= "_\|~<>".split(''); 17 | // const symMr="-/:;()$&@".split(''); 18 | // const symBr=".,?!'".split(''); 19 | const funcs = [ 20 | { title: '<< |', output: shiftLeft, flx: 1 }, 21 | { title: 'Space', output: space, flx: 2 }, 22 | { title: 'Del', output: del, flx: 1 }, 23 | { title: '| >>', output: shiftRight, flx: 1 } 24 | ]; 25 | 26 | var cap = caps; 27 | var sym = syms; 28 | 29 | const keys = [nums, topRow, middleRow, bottomRow]; 30 | const symboard = [symTr, symMr, symBr]; 31 | return ( 32 | 33 | capslock()} > 37 | Caps 38 | 39 | symslock()} > 43 | {sym ? "ABC" : "Sym"} 44 | 45 | { 46 | sym 47 | ? 48 | symboard.map((row) => { 49 | return ( 50 | 53 | {row.map((key) => { 54 | if (cap) { 55 | key = key.toUpperCase(); 56 | } 57 | return ( 58 | edit(key)} > 62 | {key} 63 | 64 | ); 65 | })} 66 | 67 | ); 68 | }) 69 | : 70 | keys.map((row) => { 71 | return ( 72 | 75 | {row.map((key) => { 76 | if (cap) { 77 | key = key.toUpperCase(); 78 | } 79 | return ( 80 | edit(key)} > 84 | {key} 85 | 86 | ); 87 | })} 88 | 89 | ); 90 | }) 91 | } 92 | 93 | {funcs.map((func) => { 94 | let flx = func.flx; 95 | return ( 96 | func.output()} > 104 | 105 | {func.title} 106 | 107 | 108 | ); 109 | } 110 | )} 111 | 112 | 113 | ); 114 | }; 115 | 116 | const styles = StyleSheet.create({ 117 | container: { 118 | flexWrap: 'wrap', 119 | marginTop: 50, 120 | padding: 10, 121 | paddingLeft: 45, 122 | paddingRight: 45, 123 | flexDirection: 'row', 124 | justifyContent: 'center' 125 | }, 126 | smallContainer: { 127 | minWidth: 360, 128 | flexWrap: 'wrap', 129 | flexDirection: 'row', 130 | justifyContent: 'center' 131 | }, 132 | hotKey: { 133 | justifyContent: 'center', 134 | alignItems: 'center', 135 | borderRadius: 5, 136 | height: 45, 137 | width: 30, 138 | marginLeft: 1, 139 | marginRight: 1, 140 | marginBottom: 5, 141 | backgroundColor: '#999999' 142 | }, 143 | funcKey: { 144 | justifyContent: 'center', 145 | alignItems: 'center', 146 | borderColor: '#888888', 147 | backgroundColor: 'transparent', 148 | borderRadius: 5, 149 | padding: 10, 150 | margin: 3, 151 | borderWidth: 1 152 | }, 153 | capsKey: { 154 | justifyContent: 'center', 155 | alignItems: 'center', 156 | borderColor: '#888888', 157 | backgroundColor: 'transparent', 158 | borderRadius: 5, 159 | padding: 10, 160 | margin: 3, 161 | borderWidth: 1 162 | }, 163 | buttonText: { 164 | color: '#444444' 165 | }, 166 | funcButtonText: { 167 | color: '#999999' 168 | } 169 | }); 170 | -------------------------------------------------------------------------------- /app/components/Buttons/OperatorButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class OperatorButton extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | OperatorKeys: [ 10 | { title: '+', output: ' + ' }, 11 | { title: '-', output: ' - ' }, 12 | { title: '=', output: ' = ' }, 13 | { title: '==', output: ' == ' }, 14 | { title: '===', output: ' === ' }, 15 | { title: '>', output: ' > ' }, 16 | { title: '<', output: ' < ' }, 17 | { title: '>=', output: '>=' }, 18 | { title: '<=', output: '<=' }, 19 | { title: '%', output: ' % ' }, 20 | { title: '&&', output: ' && ' }, 21 | { title: '||', output: ' || ' }, 22 | { title: '?', output: ' ? ' }, 23 | { title: ':', output: ' : ' }, 24 | { title: '!', output: '!' }, 25 | ], 26 | }; 27 | } 28 | 29 | render() { 30 | return ( 31 | 32 | {this.state.OperatorKeys.map((key) => { 33 | return ( 34 | ); 46 | }) 47 | } 48 | 49 | 54 | 55 | 56 | ); 57 | } 58 | } 59 | 60 | const styles = StyleSheet.create({ 61 | container: { 62 | flexWrap: 'wrap', 63 | marginTop: 50, 64 | padding: 4, 65 | flexDirection: 'row', 66 | justifyContent: 'center' 67 | }, 68 | smallContainer: { 69 | minWidth: 400, 70 | padding: 4, 71 | flexDirection: 'row', 72 | justifyContent: 'center' 73 | }, 74 | hotKey: { 75 | justifyContent: 'center', 76 | alignItems: 'center', 77 | padding: 10, 78 | marginTop: 3, 79 | marginLeft: 1, 80 | marginRight: 1, 81 | marginBottom: 5, 82 | backgroundColor: '#999999' 83 | }, 84 | backKey: { 85 | justifyContent: 'center', 86 | alignItems: 'center', 87 | width: 100, 88 | borderColor: '#666666', 89 | backgroundColor: 'transparent', 90 | padding: 10, 91 | marginTop: 5, 92 | marginBottom: 5, 93 | borderWidth: 1 94 | } 95 | }); 96 | -------------------------------------------------------------------------------- /app/components/Buttons/SpacingButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class SpacingButton extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | SpacingKeys: [ 10 | { title: 'tab', output: '\t' }, 11 | { title: 'enter', output: '\n' }, 12 | ], 13 | }; 14 | } 15 | 16 | render() { 17 | return ( 18 | 19 | {this.state.SpacingKeys.map((key) => { 20 | return ( 21 | ); 33 | }) 34 | } 35 | 36 | 41 | 42 | 43 | ); 44 | } 45 | } 46 | 47 | const styles = StyleSheet.create({ 48 | container: { 49 | flexWrap: 'wrap', 50 | marginTop: 50, 51 | padding: 4, 52 | flexDirection: 'row', 53 | justifyContent: 'center' 54 | }, 55 | smallContainer: { 56 | minWidth: 400, 57 | flexWrap: 'wrap', 58 | padding: 4, 59 | flexDirection: 'row', 60 | justifyContent: 'center' 61 | }, 62 | hotKey: { 63 | justifyContent: 'center', 64 | alignItems: 'center', 65 | padding: 10, 66 | marginTop: 3, 67 | marginLeft: 1, 68 | marginRight: 1, 69 | marginBottom: 5, 70 | backgroundColor: '#999999' 71 | }, 72 | backKey: { 73 | justifyContent: 'center', 74 | alignItems: 'center', 75 | width: 100, 76 | borderColor: '#666666', 77 | backgroundColor: 'transparent', 78 | padding: 10, 79 | marginTop: 5, 80 | marginBottom: 5, 81 | borderWidth: 1 82 | } 83 | }); 84 | -------------------------------------------------------------------------------- /app/components/Buttons/StringButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class StringButton extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | StringKeys: [ 10 | { title: 'slice', output: '.slice( )' }, 11 | { title: 'split', output: '.split()' }, 12 | { title: 'startsWith', output: '.startsWith()' }, 13 | { title: 'length', output: '.length' }, 14 | { title: 'toLowerCase', output: '.toLowerCase()' }, 15 | { title: 'toUpperCase', output: '.toUpperCase()' } 16 | ], 17 | }; 18 | } 19 | 20 | render() { 21 | return ( 22 | 23 | {this.state.StringKeys.map((key) => { 24 | return ( 25 | ); 37 | }) 38 | } 39 | 40 | 45 | 46 | 47 | ); 48 | } 49 | } 50 | 51 | const styles = StyleSheet.create({ 52 | container: { 53 | flexWrap: 'wrap', 54 | marginTop: 50, 55 | padding: 4, 56 | flexDirection: 'row', 57 | justifyContent: 'center' 58 | }, 59 | smallContainer: { 60 | minWidth: 400, 61 | flexWrap: 'wrap', 62 | padding: 4, 63 | flexDirection: 'row', 64 | justifyContent: 'center' 65 | }, 66 | hotKey: { 67 | justifyContent: 'center', 68 | alignItems: 'center', 69 | padding: 10, 70 | marginTop: 3, 71 | marginLeft: 1, 72 | marginRight: 1, 73 | marginBottom: 5, 74 | backgroundColor: '#999999' 75 | }, 76 | backKey: { 77 | justifyContent: 'center', 78 | alignItems: 'center', 79 | width: 100, 80 | borderColor: '#666666', 81 | backgroundColor: 'transparent', 82 | padding: 10, 83 | marginTop: 5, 84 | marginBottom: 5, 85 | borderWidth: 1 86 | } 87 | }); 88 | -------------------------------------------------------------------------------- /app/components/Buttons/VariableButton.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class VariableButton extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | VariableKeys: [ 10 | { title: 'let', output: 'let = ' }, 11 | { title: 'const', output: 'const = ' }, 12 | { title: 'var', output: 'var = ' }], 13 | }; 14 | } 15 | 16 | render() { 17 | return ( 18 | 19 | {this.state.VariableKeys.map((key) => { 20 | return ( 21 | ); 33 | }) 34 | } 35 | 36 | 41 | 42 | 43 | ); 44 | } 45 | } 46 | 47 | const styles = StyleSheet.create({ 48 | container: { 49 | flexWrap: 'wrap', 50 | marginTop: 50, 51 | padding: 4, 52 | flexDirection: 'row', 53 | justifyContent: 'center' 54 | }, 55 | smallContainer: { 56 | minWidth: 400, 57 | flexWrap: 'wrap', 58 | padding: 4, 59 | flexDirection: 'row', 60 | justifyContent: 'center' 61 | }, 62 | hotKey: { 63 | justifyContent: 'center', 64 | alignItems: 'center', 65 | padding: 10, 66 | marginTop: 3, 67 | marginLeft: 1, 68 | marginRight: 1, 69 | marginBottom: 5, 70 | backgroundColor: '#999999' 71 | }, 72 | backKey: { 73 | justifyContent: 'center', 74 | alignItems: 'center', 75 | width: 100, 76 | borderColor: '#666666', 77 | backgroundColor: 'transparent', 78 | padding: 10, 79 | marginTop: 5, 80 | marginBottom: 5, 81 | borderWidth: 1 82 | } 83 | }); 84 | -------------------------------------------------------------------------------- /app/components/ClipButtons.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { AppRegistry, StyleSheet, TouchableOpacity } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | import LoopsButton from './Buttons/LoopsButton'; 6 | import ConditionalButton from './Buttons/ConditionalButton'; 7 | import VariableButton from './Buttons/VariableButton'; 8 | import ArrayButton from './Buttons/ArrayButton'; 9 | import OperatorButton from './Buttons/OperatorButton'; 10 | import ActionButton from './Buttons/ActionButton'; 11 | import StringButton from './Buttons/StringButton'; 12 | import SpacingButton from './Buttons/SpacingButton'; 13 | 14 | export default class ClipButton extends Component { 15 | constructor(props) { 16 | super(props); 17 | this.state = { 18 | hotKeys: [ 19 | { title: 'Loops', comp: LoopsButton }, 20 | { title: 'Conditional', comp: ConditionalButton }, 21 | { title: 'Variable', comp: VariableButton }, 22 | { title: 'Array', comp: ArrayButton }, 23 | { title: 'Operator', comp: OperatorButton }, 24 | { title: 'Action', comp: ActionButton }, 25 | { title: 'String', comp: StringButton }, 26 | { title: 'Spacing', comp: SpacingButton }, 27 | ], 28 | selectedButton: {}, 29 | buttonPushed: false 30 | }; 31 | this.onButtonPush = this.onButtonPush.bind(this); 32 | } 33 | onButtonPush() { 34 | this.setState({ buttonPushed: !this.state.buttonPushed }); 35 | } 36 | selectButton(button) { 37 | this.setState({ selectedButton: button }); 38 | } 39 | 40 | render() { 41 | return ( 42 | 43 | { 44 | this.state.buttonPushed ? 45 | this.onButtonPush()}> 46 | 47 | 48 | : 49 | {this.state.hotKeys.map((hotkey) => { 50 | return ( 51 | ); 59 | })} 60 | 61 | } 62 | 63 | ); 64 | } 65 | } 66 | 67 | AppRegistry.registerComponent('ClipButton', () => ClipButton); 68 | 69 | const styles = StyleSheet.create({ 70 | container: { 71 | flexWrap: 'wrap', 72 | marginTop: 50, 73 | padding: 4, 74 | flexDirection: 'row', 75 | justifyContent: 'center' 76 | }, 77 | hotKey: { 78 | justifyContent: 'center', 79 | alignItems: 'center', 80 | padding: 10, 81 | marginTop: 3, 82 | marginLeft: 1, 83 | marginRight: 1, 84 | marginBottom: 5, 85 | backgroundColor: '#999999' 86 | } 87 | }); 88 | -------------------------------------------------------------------------------- /app/components/CodeHeader.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Header, Left, Body, Right, Button, Icon, Title, Text } from 'native-base'; 3 | 4 | export default class CodeHeader extends Component { 5 | constructor(props) { 6 | super(props); 7 | this.onBackPress = this.onBackPress.bind(this); 8 | } 9 | 10 | onBackPress() { 11 | this.props.navigator.push({ id: 'all-questions-component' }) 12 | } 13 | 14 | render() { 15 | return ( 16 |
17 | 18 | 26 | 27 | 28 | {`CodeTap`} 29 | 30 | 31 | 40 | 41 |
42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/components/Editor/BasicKeyboard.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { View, AppRegistry, StyleSheet, Button, Text, TouchableOpaci} from 'react-native'; 3 | import NumsLetters from '../Buttons/NumsLetters'; 4 | export default class BasicKeyboard extends Component { 5 | constructor(props) { 6 | super(props); 7 | this.state={ 8 | caps:false, 9 | syms:false 10 | }; 11 | this.changeCaps=this.changeCaps.bind(this); 12 | this.changeSyms=this.changeSyms.bind(this); 13 | } 14 | changeCaps(){ 15 | let newState = !this.state.caps; 16 | this.setState({ 17 | caps:newState 18 | }); 19 | } 20 | 21 | changeSyms(){ 22 | let newBoard = !this.state.syms; 23 | this.setState({ 24 | syms:newBoard 25 | }); 26 | } 27 | render(){ 28 | return ( 29 | 30 | 40 | 41 | ); 42 | } 43 | } 44 | 45 | const styles = StyleSheet.create({ 46 | container: { 47 | flexWrap: 'wrap', 48 | justifyContent: 'center', 49 | alignItems: 'flex-start' 50 | } 51 | }); 52 | -------------------------------------------------------------------------------- /app/components/Editor/KeyBoard.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { TouchableWithoutFeedback, View, AppRegistry, Keyboard, StyleSheet, Button, TextInput, TouchableOpacity, Clipboard } from 'react-native'; 3 | 4 | export default class CodeKeyboard extends Component { 5 | constructor(props) { 6 | super(props); 7 | this.state = { 8 | switchVal:this.props.switchVal 9 | }; 10 | } 11 | render() { 12 | return ( 13 | 14 | this.props.onSwitchChange} 17 | editable={!this.props.switchVal} 18 | style={styles.textInput} 19 | onChangeText={text => {this.props.textEnvChange(text);}} 20 | value={this.props.textValue} 21 | onSelectionChange={(e) => {this.props.onSelectionChange(e);}} 22 | clearTextOnFocus={false} 23 | multiline={true} 24 | ref={'input'} 25 | /> 26 | 27 | ); 28 | } 29 | } 30 | 31 | AppRegistry.registerComponent('CodeKeyboard', () => CodeKeyboard); 32 | 33 | const styles = StyleSheet.create({ 34 | textInput: { 35 | color: 'white', 36 | fontSize: 18, 37 | height: 200, 38 | padding: 15, 39 | paddingTop: 15, 40 | marginTop: 4, 41 | marginBottom: 4, 42 | backgroundColor: '#666666', 43 | borderRadius: 10 44 | 45 | }, 46 | }); 47 | -------------------------------------------------------------------------------- /app/components/Editor/NewCodeEnv.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Switch, View, AppRegistry, StyleSheet, Button, Text, TouchableOpaci, ScrollView } from 'react-native'; 3 | import { Container } from 'native-base'; 4 | 5 | import BasicKeyboard from './BasicKeyboard'; 6 | import SmartKeyboard from '../ClipButtons'; 7 | import CodeHeader from '../CodeHeader'; 8 | import NewSwitchView from './NewSwitchView'; 9 | 10 | export default class NewCodeEnv extends Component { 11 | constructor(props) { 12 | super(props); 13 | const focus = (this.props.userAnswer) ? this.props.textStates[this.props.textStates.length - 1].focus : this.props.question.boilerPlate.length - 3; 14 | const inputBody = (this.props.userAnswer) ? this.props.userAnswer : this.props.question.boilerPlate.slice(0, focus)+'|'+this.props.question.boilerPlate.slice(focus, this.props.question.boilerPlate.length); 15 | const textStates= this.props.textStates || [{body:inputBody, focus:focus}]; 16 | this.state = { 17 | inputBody:inputBody, 18 | focus:focus, 19 | description: this.props.question.description, 20 | textStates: textStates, 21 | switchVal:false, 22 | showQuestion: false 23 | }; 24 | 25 | this.onChangeText=this.onChangeText.bind(this); 26 | this.shiftLeft=this.shiftLeft.bind(this); 27 | this.shiftRight=this.shiftRight.bind(this); 28 | this.del=this.del.bind(this); 29 | this.space=this.space.bind(this); 30 | this.undo=this.undo.bind(this); 31 | this.onSubmit=this.onSubmit.bind(this); 32 | this.onQuestionSwitchChange=this.onQuestionSwitchChange.bind(this); 33 | this.onSwitchChange=this.onSwitchChange.bind(this); 34 | } 35 | 36 | 37 | //Text management functions 38 | onChangeText(str){ 39 | const body = this.state.inputBody; 40 | const focus = this.state.focus; 41 | const bodyPreFocus = body.slice(0, focus); 42 | const bodyPostFocus = body.slice(focus+1, body.length); 43 | const newFocus = focus+str.length; 44 | const newBody = bodyPreFocus+str+"|"+bodyPostFocus; 45 | 46 | this.setState({ 47 | inputBody: newBody, 48 | focus: newFocus, 49 | textStates: [...this.state.textStates, {body:newBody, focus:newFocus}] 50 | }); 51 | } 52 | 53 | shiftLeft(){ 54 | const focus = this.state.focus; 55 | const newFocus = focus-1; 56 | const body = this.state.inputBody; 57 | const bodyPreFocus = body.slice(0, focus); 58 | const bodyPostFocus = body.slice(focus+1); 59 | const newBody= bodyPreFocus+bodyPostFocus; 60 | const newBodyPre = newBody.slice(0, newFocus); 61 | const newBodyPost = newBody.slice(newFocus); 62 | if(newFocus>-1){ 63 | console.log('prefocus', bodyPreFocus); 64 | console.log('postfocus', bodyPostFocus); 65 | const shiftedBody = newBodyPre+'|'+newBodyPost; 66 | this.setState({ 67 | inputBody: shiftedBody, 68 | focus:newFocus}); 69 | } 70 | } 71 | 72 | shiftRight(){ 73 | const focus = this.state.focus; 74 | const newFocus = focus+1; 75 | const body = this.state.inputBody; 76 | const bodyPreFocus = body.slice(0, focus); 77 | const bodyPostFocus = body.slice(focus+1); 78 | const newBody= bodyPreFocus+bodyPostFocus; 79 | const newBodyPre = newBody.slice(0, newFocus); 80 | const newBodyPost = newBody.slice(newFocus); 81 | 82 | if(newFocus<=newBody.length){ 83 | const shiftedBody = newBodyPre+'|'+newBodyPost; 84 | this.setState({ 85 | inputBody: shiftedBody, 86 | focus:newFocus}); 87 | } 88 | } 89 | 90 | //Text altering functions 91 | del(){ 92 | const focus = this.state.focus; 93 | const newFocus = focus-1; 94 | const body = this.state.inputBody; 95 | const bodyPreFocus = body.slice(0, newFocus)+'|'; 96 | const bodyPostFocus = body.slice(focus+1); 97 | const newBody= bodyPreFocus+bodyPostFocus; 98 | if(newFocus>-1){ 99 | this.setState({ 100 | inputBody: newBody, 101 | focus:newFocus, 102 | textStates: [...this.state.textStates, {body:newBody, focus:newFocus}] 103 | }); 104 | } 105 | } 106 | 107 | space(){ 108 | return(this.onChangeText(' ')); 109 | } 110 | 111 | //Navigation functions 112 | 113 | onSubmit() { 114 | const body = this.state.inputBody; 115 | const Answer =body.slice(0, this.state.focus)+body.slice(this.state.focus+1, body.length); 116 | 117 | this.props.navigator.push({ 118 | id: 'test-env', 119 | userAnswer: Answer, 120 | tests: this.props.question.tests, 121 | textStates: this.state.textStates, 122 | description: this.state.description 123 | }); 124 | } 125 | 126 | onBackPress() { 127 | this.props.navigator.push({ id: 'homecomponent' }); 128 | } 129 | 130 | //Switch Management Functions 131 | 132 | onSwitchChange(value) { 133 | this.setState({ 134 | switchVal: value 135 | }); 136 | if (this.state.showQuestion) { 137 | this.setState({ 138 | showQuestion: false 139 | }); 140 | } 141 | } 142 | 143 | onQuestionSwitchChange(value) { 144 | this.setState({ 145 | showQuestion: value 146 | }); 147 | if (this.state.switchVal) { 148 | this.setState({ 149 | switchVal: false 150 | }); 151 | } 152 | 153 | } 154 | 155 | //Undo State management functions 156 | 157 | undo() { 158 | console.log(this.state.textStates); 159 | if (this.state.textStates.length === 1) return false; 160 | const statesPlaceHolder = this.state.textStates; 161 | statesPlaceHolder.pop(); 162 | const lastInd = statesPlaceHolder.length - 1; 163 | 164 | this.setState({ 165 | inputBody: statesPlaceHolder[lastInd].body, 166 | focus:statesPlaceHolder[lastInd].focus, 167 | textStates: [...statesPlaceHolder] 168 | }); 169 | } 170 | 171 | 172 | 173 | render(){ 174 | return ( 175 | 176 | 180 | 181 | 182 | 183 | 185 | {this.state.inputBody} 186 | 187 | 188 | 189 | 203 | 204 | 205 | ); 206 | } 207 | } 208 | 209 | const styles = StyleSheet.create({ 210 | container: { 211 | flex: 1, 212 | padding: 10, 213 | justifyContent: 'space-between', 214 | backgroundColor: '#333333' 215 | }, 216 | inputTextBg: { 217 | backgroundColor: '#6E3F3D', 218 | borderRadius: 10, 219 | marginTop: 4, 220 | marginBottom: 4 221 | }, 222 | textInput: { 223 | flex: 1, 224 | color: 'white', 225 | fontSize: 18, 226 | padding: 15, 227 | paddingTop: 15, 228 | borderRadius: 10, 229 | backgroundColor: 'transparent' 230 | }, 231 | }); 232 | -------------------------------------------------------------------------------- /app/components/Editor/NewSwitchView.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, Switch, StyleSheet} from 'react-native'; 3 | import { Container, Header, DeckSwiper, Card, CardItem, Thumbnail, Left, Body, Icon, Button, Input, View } from 'native-base'; 4 | 5 | import BasicKeyboard from './BasicKeyboard'; 6 | import SmartKeyboard from '../ClipButtons'; 7 | 8 | export default ({switchVal, onSwitchChange, onQuestionSwitchChange, switchQuestion, description, edit, showQuestion, undo, shiftLeft, shiftRight, del, space}) => { 9 | return ( 10 | 11 | 12 | 13 | 18 | 19 | 20 | Hot Keys 21 | onSwitchChange(value)} /> 24 | 25 | 26 | Detailed Question 27 | {onQuestionSwitchChange(value);}} /> 30 | 31 | 32 | 33 | 34 | { 35 | showQuestion ? 36 | 37 | {description} 38 | 39 | : 40 | 41 | {switchVal ? 42 | 43 | 46 | 47 | : 48 | } 55 | 56 | } 57 | 58 | 59 | 60 | ); 61 | }; 62 | 63 | const styles = StyleSheet.create({ 64 | container: { 65 | flex: 1, 66 | flexDirection: 'column', 67 | flexWrap: 'wrap', 68 | }, 69 | midRow: { 70 | flex: 1, 71 | maxHeight: 45, 72 | flexDirection: 'row', 73 | alignItems: 'center' 74 | }, 75 | undoButton: { 76 | justifyContent: 'center', 77 | padding: 10, 78 | marginTop: 3, 79 | marginLeft: 2, 80 | marginRight: 2, 81 | marginBottom: 5, 82 | backgroundColor: '#cccccc' 83 | } 84 | }); 85 | -------------------------------------------------------------------------------- /app/components/Editor/SwitchView.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, Switch, StyleSheet} from 'react-native'; 3 | import { Container, Header, DeckSwiper, Card, CardItem, Thumbnail, Left, Body, Icon, Button, Input, View } from 'native-base'; 4 | 5 | 6 | import ClipButtons from '../ClipButtons'; 7 | 8 | export default ({switchVal, onSwitchChange, onQuestionSwitchChange, switchQuestion, description, edit, showQuestion, undo}) => { 9 | return ( 10 | 11 | 12 | 13 | 18 | 19 | 20 | Smart Keyboard 21 | {onSwitchChange(value);}} /> 24 | 25 | 26 | Detailed Question 27 | {onQuestionSwitchChange(value);}} /> 30 | 31 | 32 | 33 | 34 | { 35 | showQuestion ? 36 | 37 | {description} 38 | 39 | : null 40 | } 41 | { 42 | switchVal ? 43 | 44 | 45 | 46 | : 47 | null 48 | } 49 | 50 | 51 | 52 | ); 53 | }; 54 | 55 | const styles = StyleSheet.create({ 56 | container: { 57 | flex: 1, 58 | flexDirection: 'column', 59 | flexWrap: 'wrap', 60 | }, 61 | midRow: { 62 | flex: 1, 63 | maxHeight: 45, 64 | flexDirection: 'row', 65 | alignItems: 'center' 66 | }, 67 | undoButton: { 68 | justifyContent: 'center', 69 | padding: 10, 70 | marginTop: 3, 71 | marginLeft: 2, 72 | marginRight: 2, 73 | marginBottom: 5, 74 | backgroundColor: '#cccccc' 75 | } 76 | }); 77 | -------------------------------------------------------------------------------- /app/components/Editor/TextIDE.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { TextInput, StyleSheet } from 'react-native'; 3 | 4 | export default ({ textEnvChange, textValue, textFocus, onSelectionChange, cursorBlur, switchVal }) => { 5 | 6 | return ( 7 | {textEnvChange(text);}} 11 | value={textValue} 12 | onFocus={textFocus} 13 | editable={!switchVal} 14 | selectTextOnFocus={!switchVal} 15 | onSelectionChange={(e) => {onSelectionChange(e);}} 16 | clearTextOnFocus={false} 17 | multiline={true} 18 | /> 19 | ); 20 | }; 21 | const styles = StyleSheet.create({ 22 | textInput: { 23 | color: 'white', 24 | fontSize: 18, 25 | height: 200, 26 | padding: 15, 27 | paddingTop: 15, 28 | marginTop: 4, 29 | marginBottom: 4, 30 | backgroundColor: '#666666', 31 | borderRadius: 10 32 | 33 | }, 34 | }); 35 | -------------------------------------------------------------------------------- /app/components/Header.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Header, Left, Body, Right, Button, Icon, Title, Text } from 'native-base'; 3 | 4 | export default class HeaderComponent extends Component { 5 | constructor(props) { 6 | super(props); 7 | this.onBackPress = this.onBackPress.bind(this); 8 | } 9 | 10 | onBackPress() { 11 | this.props.navigator.push({ id: 'all-questions-component' }) 12 | } 13 | onCancelPress() { 14 | this.props.navigator.push({ id: 'homecomponent' }) 15 | } 16 | 17 | render() { 18 | return ( 19 |
20 | 21 | 29 | 30 | 31 | CodeTap 32 | 33 | 34 | 40 | 41 |
42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/components/Home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { AppRegistry, StyleSheet } from 'react-native'; 3 | import { View, Text, Button } from 'native-base'; 4 | 5 | export default class HomeComponent extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.onPress = this.onPress.bind(this); 9 | } 10 | 11 | onPress() { 12 | this.props.navigator.push({ 13 | id: 'all-questions-component' 14 | }); 15 | } 16 | render() { 17 | return ( 18 | 19 | Code to Train.{'\n'}Train to Code. Purple MOnkey 27 | 38 | 39 | ); 40 | } 41 | } 42 | 43 | AppRegistry.registerComponent('HomeComponent', () => HomeComponent); 44 | 45 | const styles = StyleSheet.create({ 46 | container: { 47 | flex: 1, 48 | backgroundColor: '#550000', 49 | alignItems: 'center', 50 | justifyContent: 'center', 51 | }, 52 | }); 53 | -------------------------------------------------------------------------------- /app/components/SingleQuestion.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { Container, Content, View, Text, Icon, Button } from 'native-base'; 4 | 5 | import HeaderComponent from './Header.js' 6 | 7 | export default class SingleQuestionComponent extends Component { 8 | //consider destructuring {question: { title, tests, boilerPlate, description}} 9 | constructor(props) { 10 | super(props); 11 | this.state = { 12 | title: this.props.question.title, 13 | tests: this.props.question.tests, 14 | likes: this.props.question.likes, 15 | boilerPlate: this.props.question.boilerPlate, 16 | description: this.props.question.description 17 | }; 18 | //consider Arrow functions 19 | this.onBackPress = this.onBackPress.bind(this); 20 | this.onCodePress = this.onCodePress.bind(this); 21 | } 22 | 23 | // go back to all questions list 24 | onBackPress() { 25 | this.props.navigator.push({ 26 | id: 'all-questions-component' 27 | }); 28 | } 29 | 30 | // navigate to the code environment to begin question 31 | onCodePress() { 32 | this.props.navigator.push({ 33 | id: 'Code-Env', 34 | question: this.state 35 | }); 36 | } 37 | 38 | render() { 39 | return ( 40 | 41 | 42 | 43 | 44 | 50 | 58 | {` ${this.props.question.likes}`} 64 | {this.state.title} 73 | {` `} 80 | 81 | 82 | 95 | { 96 | this.state.tests.map(test => { 97 | return ( 98 | 99 | Inputs: {test.inputs.join(', ')} 105 | Output: {test.output.join(' ')} 111 | 112 | ) 113 | }) 114 | } 115 | 116 | {this.state.description} 124 | 140 | 141 | 142 | ); 143 | } 144 | } 145 | 146 | const styles = StyleSheet.create({ 147 | container: { 148 | flex: 1, 149 | flexDirection: 'column', 150 | paddingTop: 12, 151 | backgroundColor: '#333333' 152 | } 153 | }); 154 | -------------------------------------------------------------------------------- /app/components/TestEnv.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet, WebView } from 'react-native'; 3 | 4 | export default class TestEnvComponent extends Component { 5 | constructor(props) { 6 | super(props); 7 | 8 | this.state = { 9 | questionTitle: '', 10 | userAnswer: this.props.userAnswer, 11 | tests: this.props.tests, 12 | questionDescription: '', 13 | textStates: this.props.textStates, 14 | isPassing: false, 15 | resultArr: [] 16 | } 17 | this.navigateBack = this.navigateBack.bind(this); 18 | this.navigateToAllQuestions = this.navigateToAllQuestions.bind(this); 19 | } 20 | 21 | navigateBack(msg) { 22 | // if (msg === 'infinite loop') { 23 | // // need to redirect to new CodeEnv and supply warning with hidden btn 24 | // } 25 | 26 | this.props.navigator.push({ 27 | id: 'back-code-env', 28 | userAnswer: this.props.userAnswer, 29 | textStates: this.props.textStates, 30 | question: { 31 | description: this.props.description, 32 | tests: this.props.tests 33 | } 34 | }) 35 | } 36 | 37 | navigateToAllQuestions() { 38 | this.props.navigator.push({ id: 'all-questions-component' }) 39 | } 40 | 41 | // called after webview is loaded 42 | webViewLoaded() { 43 | console.log('shit loaded!') 44 | 45 | var callFunc; 46 | 47 | eval(`callFunc = ${this.state.userAnswer}`); 48 | 49 | // this timer checks if a test causes an infinite loop and will cancel out the webview component container 50 | timer = setTimeout(() => { 51 | this.navigateBack('infinite loop'); //signifies to CodeEnv to warn user about infinite loop 52 | }, 10000) 53 | 54 | const dataObj = { 55 | func: callFunc.toString(), 56 | finished: false 57 | } 58 | 59 | for (var i = 0; i < this.state.tests.length; ++i) { 60 | if (i === this.state.tests.length - 1) dataObj.finished = true; 61 | console.log(this.state.tests[i]); 62 | dataObj.test = this.state.tests[i]; 63 | 64 | this.webview.postMessage(JSON.stringify(dataObj)); 65 | } 66 | } 67 | 68 | getMessageFromWebView(data) { 69 | const msg = data.nativeEvent.data.trim(); 70 | console.log('herro', msg); 71 | 72 | if (msg === 'finished') { 73 | clearTimeout(timer); 74 | } 75 | if (msg === 'Complete') { 76 | this.props.navigator.push({ 77 | id: 'all-questions-component' 78 | }) 79 | } 80 | // redirect to CodeEnv 81 | if (msg === 'Try again') { 82 | console.log('yooo') 83 | this.navigateBack(); 84 | } 85 | } 86 | 87 | render() { 88 | return ( 89 | { this.webview = webview }} 92 | source={require('../webviewScripts/load.html')} 93 | onLoad={this.webViewLoaded.bind(this)} 94 | onMessage={this.getMessageFromWebView.bind(this)} /> 95 | ) 96 | } 97 | } 98 | 99 | const styles = StyleSheet.create({ 100 | container: { 101 | flex: 1, 102 | flexDirection: 'column', 103 | padding: 10, 104 | paddingTop: 12, 105 | backgroundColor: '#333333' 106 | }, 107 | topRowContainer: { 108 | flex: 1 109 | }, 110 | resultButton: { 111 | flex: 1, 112 | alignSelf: 'center', 113 | backgroundColor: '#339933' 114 | 115 | }, 116 | resultDetails: { 117 | paddingTop: 3, 118 | paddingBottom: 10 119 | }, 120 | resultText: { 121 | color: '#dd0000', 122 | marginTop: 10, 123 | marginBottom: 10, 124 | fontWeight: 'bold', 125 | fontSize: 22, 126 | textAlign: 'center', 127 | paddingTop: 35, 128 | paddingBottom: 35, 129 | borderColor: '#dd0000', 130 | borderWidth: 2.5, 131 | backgroundColor: '#bbb' 132 | }, 133 | inputOutput: { 134 | flex: 1, 135 | backgroundColor: '#555555', 136 | borderWidth: 1, 137 | borderColor: '#555555', 138 | padding: 15, 139 | paddingBottom: 15, 140 | borderRadius: 10 141 | } 142 | }) 143 | -------------------------------------------------------------------------------- /app/components/img/front-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/app/components/img/front-page.png -------------------------------------------------------------------------------- /app/components/img/fs-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/app/components/img/fs-logo.png -------------------------------------------------------------------------------- /app/components/img/fullstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/app/components/img/fullstack.png -------------------------------------------------------------------------------- /app/components/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/app/components/img/loading.gif -------------------------------------------------------------------------------- /app/webviewScripts/load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 98 | 99 |
100 | 103 | 106 | 107 | 108 |
109 | 110 |
111 |
112 | 113 |
114 | 117 |
118 | 119 | 120 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /codeTapSplash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codetwogo/CodeTap/264015c79951d7d96db210694092c8bd2fd936ff/codeTapSplash.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codetwogo", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "enzyme": "^2.9.1", 7 | "jest-expo": "^36.0.0", 8 | "lodash": "^4.17.4", 9 | "react-native-scripts": "1.1.0", 10 | "react-shallow-testutils": "^3.0.0", 11 | "react-test-renderer": "16.0.0-alpha.12" 12 | }, 13 | "main": "node_modules/expo/AppEntry.js", 14 | "scripts": { 15 | "start": "react-native-scripts start", 16 | "eject": "react-native-scripts eject", 17 | "android": "react-native-scripts android", 18 | "ios": "react-native-scripts ios", 19 | "test": "node node_modules/jest/bin/jest.js --watch", 20 | "jest": "jest -u" 21 | }, 22 | "jest": { 23 | "preset": "jest-expo" 24 | }, 25 | "dependencies": { 26 | "@babel/plugin-transform-react-jsx": "^7.8.3", 27 | "@expo/vector-icons": "^10.0.0", 28 | "@react-native-community/netinfo": "^5.3.3", 29 | "expo": "^36.0.0", 30 | "native-base": "^2.3.1", 31 | "react": "16.9.0", 32 | "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz", 33 | "react-native-deprecated-custom-components": "^0.1.1", 34 | "react-native-netinfo": "^1.1.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/__snapshots__/components.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`The AllQuestions Component... matches snapshot 1`] = ` 4 | 11 | 20 | 21 | 48 | 59 | 70 | Question1 71 | 72 | 73 | 74 | 101 | 112 | 123 | Question2 124 | 125 | 126 | 127 | 154 | 165 | 176 | Question3 177 | 178 | 179 | 180 | 181 | 182 | 210 | 217 | 233 | Go back to base 234 | 235 | 236 | 237 | 238 | `; 239 | 240 | exports[`The Home Component... matches snapshot 1`] = ` 241 | 251 | 257 | Welcome to the Home Component 258 | 259 | 287 | 294 | 310 | Start a War 311 | 312 | 313 | 314 | 315 | `; 316 | 317 | exports[`The SingleQuestion Component... matches snapshot 1`] = ` 318 | 328 | 334 | testing-question 335 | 336 | 342 | tests 343 | 344 | 350 | 1234 351 | 352 | 380 | 387 | 403 | Go Back 404 | 405 | 406 | 407 | 408 | `; 409 | 410 | exports[`The main App Entry Point... matches snapshot 1`] = ` 411 | 422 | 444 | 492 | 502 | 508 | Welcome to the Home Component 509 | 510 | 538 | 545 | 561 | Start a War 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | `; 570 | -------------------------------------------------------------------------------- /tests/components.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import App from '../App'; 3 | import Home from '../app/components/Home'; 4 | import AllQuestions from '../app/components/AllQuestions'; 5 | import SingleQuestion from '../app/components/SingleQuestion'; 6 | 7 | import renderer from 'react-test-renderer'; 8 | //import {shallow} from 'enzyme'; 9 | import shallowRenderer from 'react-test-renderer/shallow'; 10 | import { isDOMComponent, isComponentOfType, findWithType } from 'react-shallow-testutils'; 11 | 12 | const shallow = new shallowRenderer(); 13 | 14 | describe('The main App Entry Point...', () => { 15 | 16 | const component = renderer.create() 17 | 18 | it('renders without crashing', () => { 19 | const rendered = component.toJSON(); 20 | expect(rendered).toBeTruthy(); 21 | }); 22 | 23 | it('matches snapshot', () => { 24 | const rendered = component.toJSON(); 25 | expect(rendered).toMatchSnapshot(); 26 | // console.log(rendered.find('Navigator')); 27 | }) 28 | }) 29 | 30 | describe('The Home Component...', () => { 31 | 32 | const component = renderer.create() 33 | 34 | it('renders without crashing', () => { 35 | const rendered = component; 36 | expect(rendered).toBeTruthy(); 37 | }); 38 | 39 | it('matches snapshot', () => { 40 | const rendered = component.toJSON(); 41 | expect(rendered).toMatchSnapshot(); 42 | }) 43 | }) 44 | 45 | describe('The AllQuestions Component...', () => { 46 | 47 | const component = renderer.create() 48 | 49 | it('renders without crashing', () => { 50 | const rendered = component.toJSON(); 51 | expect(rendered).toBeTruthy(); 52 | }); 53 | 54 | it('matches snapshot', () => { 55 | const rendered = component.toJSON(); 56 | expect(rendered).toMatchSnapshot(); 57 | // console.log(rendered.find('Navigator')); 58 | }) 59 | }) 60 | 61 | describe('The SingleQuestion Component...', () => { 62 | 63 | const component = renderer.create() 69 | 70 | it('renders without crashing', () => { 71 | const rendered = component.toJSON(); 72 | expect(rendered).toBeTruthy(); 73 | }); 74 | 75 | it('matches snapshot', () => { 76 | const rendered = component.toJSON(); 77 | expect(rendered).toMatchSnapshot(); 78 | // console.log(rendered.find('Navigator')); 79 | }) 80 | }) --------------------------------------------------------------------------------