├── .watchmanconfig ├── src ├── redux │ ├── types.js │ ├── middleware.js │ ├── actions │ │ ├── types.js │ │ └── places.js │ ├── store.js │ └── reducers │ │ ├── index.js │ │ └── reducers.js ├── Config │ └── URL.js ├── screens │ ├── AuthLoading.js │ ├── Route.js │ ├── Home │ │ └── index.js │ ├── Login │ │ └── index.js │ ├── PlayGround │ │ └── index.js │ └── Register │ │ └── index.js └── library │ └── components │ └── CrossWordCategory.js ├── .gitattributes ├── GAME.png ├── app.json ├── LOGIN.png ├── DASHBOARD.png ├── QUESTIONS.png ├── babel.config.js ├── android ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ ├── Entypo.ttf │ │ │ │ │ ├── Feather.ttf │ │ │ │ │ ├── Zocial.ttf │ │ │ │ │ ├── AntDesign.ttf │ │ │ │ │ ├── EvilIcons.ttf │ │ │ │ │ ├── Fontisto.ttf │ │ │ │ │ ├── Foundation.ttf │ │ │ │ │ ├── Ionicons.ttf │ │ │ │ │ ├── Octicons.ttf │ │ │ │ │ ├── FontAwesome.ttf │ │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ │ │ └── MaterialCommunityIcons.ttf │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── rncrossword │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ └── AndroidManifest.xml │ │ └── debug │ │ │ └── AndroidManifest.xml │ ├── build_defs.bzl │ ├── proguard-rules.pro │ ├── BUCK │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── keystores │ ├── debug.keystore.properties │ └── BUCK ├── gradle.properties ├── settings.gradle ├── build.gradle ├── gradlew.bat └── gradlew ├── ios ├── RNcrossword │ ├── Images.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── AppDelegate.m │ ├── Info.plist │ └── Base.lproj │ │ └── LaunchScreen.xib ├── RNcrosswordTests │ ├── Info.plist │ └── RNcrosswordTests.m ├── RNcrossword-tvOSTests │ └── Info.plist ├── RNcrossword-tvOS │ └── Info.plist └── RNcrossword.xcodeproj │ ├── xcshareddata │ └── xcschemes │ │ ├── RNcrossword.xcscheme │ │ └── RNcrossword-tvOS.xcscheme │ └── project.pbxproj ├── .buckconfig ├── index.js ├── __tests__ └── App-test.js ├── metro.config.js ├── App.js ├── .gitignore ├── assets └── img │ └── bg.svg ├── LICENSE ├── package.json ├── .flowconfig └── README.md /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/redux/types.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/redux/middleware.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /src/Config/URL.js: -------------------------------------------------------------------------------- 1 | export default URL = `http://192.168.0.24:3333` -------------------------------------------------------------------------------- /GAME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/GAME.png -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RNcrossword", 3 | "displayName": "RNcrossword" 4 | } -------------------------------------------------------------------------------- /LOGIN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/LOGIN.png -------------------------------------------------------------------------------- /DASHBOARD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/DASHBOARD.png -------------------------------------------------------------------------------- /QUESTIONS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/QUESTIONS.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RNcrossword 3 | 4 | -------------------------------------------------------------------------------- /ios/RNcrossword/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/AntDesign.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/AntDesign.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Fontisto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Fontisto.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /src/redux/actions/types.js: -------------------------------------------------------------------------------- 1 | export const ADD_CROSSWORD = 'ADD_CROSSWORD' 2 | export const GET_QUESTIONS = 'GET_QUESTIONS' 3 | export const ADD_ANSWERS = 'ADD_ANSWERS' -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihsaninh/crossword-react-native/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import {AppRegistry} from 'react-native'; 2 | import App from './App'; 3 | import {name as appName} from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | 7 | console.disableYellowBox = true; 8 | -------------------------------------------------------------------------------- /__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import App from '../App'; 4 | 5 | import renderer from 'react-test-renderer'; 6 | 7 | it('renders correctly', () => { 8 | renderer.create(); 9 | }); 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /src/redux/store.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware } from 'redux' 2 | import logger from 'redux-logger' 3 | import appReducer from './reducers/index' 4 | import thunk from 'redux-thunk' 5 | import promise from 'redux-promise-middleware' 6 | 7 | const middleware = applyMiddleware(thunk, logger, promise) 8 | const store = createStore(appReducer, {}, middleware) 9 | export { 10 | store 11 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { Provider } from 'react-redux' 4 | import { store } from './src/redux/store' 5 | import AppContainer from './src/screens/Route' 6 | 7 | export default class App extends Component { 8 | render() { 9 | return ( 10 | 11 | 12 | 13 | ); 14 | } 15 | } -------------------------------------------------------------------------------- /src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | import { createNavigationReducer } from 'react-navigation-redux-helpers' 3 | 4 | import RootNavigation from '../../screens/Route' 5 | import reducers from './reducers' 6 | 7 | const router = createNavigationReducer(RootNavigation); 8 | 9 | const appReducer = combineReducers({ 10 | router, 11 | reducers 12 | }) 13 | 14 | export default appReducer -------------------------------------------------------------------------------- /ios/RNcrossword/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ios/RNcrossword/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /ios/RNcrossword/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/RNcrosswordTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/RNcrossword-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'RNcrossword' 2 | include ':react-native-linear-gradient' 3 | project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') 4 | include ':react-native-vector-icons' 5 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 6 | include ':react-native-gesture-handler' 7 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android') 8 | include ':react-native-linear-gradient' 9 | project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') 10 | // include ':react-native-svg' 11 | // project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') 12 | 13 | include ':app' 14 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rncrossword/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.rncrossword; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; 7 | 8 | public class MainActivity extends ReactActivity { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. 12 | * This is used to schedule rendering of the component. 13 | */ 14 | @Override 15 | protected String getMainComponentName() { 16 | return "RNcrossword"; 17 | } 18 | @Override 19 | protected ReactActivityDelegate createReactActivityDelegate() { 20 | return new ReactActivityDelegate(this, getMainComponentName()) { 21 | @Override 22 | protected ReactRootView createRootView() { 23 | return new RNGestureHandlerEnabledRootView(MainActivity.this); 24 | } 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | supportLibVersion = "28.0.0" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:3.4.0") 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenLocal() 26 | google() 27 | jcenter() 28 | maven { 29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 30 | url "$rootDir/../node_modules/react-native/android" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /assets/img/bg.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ihsan Nurul Habib 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/screens/AuthLoading.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { ActivityIndicator, View, AsyncStorage, StyleSheet } from 'react-native' 3 | import { withNavigation } from 'react-navigation' 4 | 5 | 6 | class AuthLoading extends Component { 7 | constructor() { 8 | super(); 9 | this._bootstrapAsync(); 10 | } 11 | _bootstrapAsync = async () => { 12 | const userToken = await AsyncStorage.getItem('token'); 13 | this.props.navigation.navigate(userToken ? 'App' : 'Auth') 14 | } 15 | 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | 22 | ); 23 | } 24 | } 25 | const styles = StyleSheet.create({ 26 | container: { 27 | flex: 1, 28 | justifyContent: 'center' 29 | }, 30 | horizontal: { 31 | flexDirection: 'row', 32 | justifyContent: 'space-around', 33 | padding: 10 34 | } 35 | }) 36 | 37 | 38 | export default withNavigation(AuthLoading); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RNcrossword", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.19.0", 11 | "react": "16.8.3", 12 | "react-native": "0.59.10", 13 | "react-native-awesome-alerts": "^1.2.0", 14 | "react-native-elements": "^1.1.0", 15 | "react-native-gesture-handler": "^1.3.0", 16 | "react-native-linear-gradient": "^2.5.4", 17 | "react-native-raw-bottom-sheet": "^2.0.2", 18 | "react-native-svg": "^9.5.1", 19 | "react-native-vector-icons": "^6.6.0", 20 | "react-navigation": "^3.11.0", 21 | "react-navigation-redux-helpers": "^3.0.2", 22 | "react-redux": "^7.1.0", 23 | "redux": "^4.0.1", 24 | "redux-logger": "^3.0.6", 25 | "redux-persist": "^5.10.0", 26 | "redux-promise-middleware": "^6.1.1", 27 | "redux-thunk": "^2.3.0" 28 | }, 29 | "devDependencies": { 30 | "@babel/core": "^7.5.0", 31 | "@babel/runtime": "^7.5.1", 32 | "babel-jest": "^24.8.0", 33 | "jest": "^24.8.0", 34 | "metro-react-native-babel-preset": "^0.55.0", 35 | "react-native-svg-transformer": "^0.13.0", 36 | "react-test-renderer": "16.8.3" 37 | }, 38 | "jest": { 39 | "preset": "react-native" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.rncrossword", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.rncrossword", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /ios/RNcrossword/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 20 | moduleName:@"RNcrossword" 21 | initialProperties:nil]; 22 | 23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 26 | UIViewController *rootViewController = [UIViewController new]; 27 | rootViewController.view = rootView; 28 | self.window.rootViewController = rootViewController; 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 34 | { 35 | #if DEBUG 36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 37 | #else 38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 39 | #endif 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/rncrossword/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.rncrossword; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.BV.LinearGradient.LinearGradientPackage; 7 | import com.oblador.vectoricons.VectorIconsPackage; 8 | import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; 9 | import com.facebook.react.ReactNativeHost; 10 | import com.facebook.react.ReactPackage; 11 | import com.facebook.react.shell.MainReactPackage; 12 | import com.facebook.soloader.SoLoader; 13 | import com.BV.LinearGradient.LinearGradientPackage; 14 | // import com.horcrux.svg.SvgPackage; 15 | 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | public class MainApplication extends Application implements ReactApplication { 20 | 21 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 22 | @Override 23 | public boolean getUseDeveloperSupport() { 24 | return BuildConfig.DEBUG; 25 | } 26 | 27 | @Override 28 | protected List getPackages() { 29 | return Arrays.asList( 30 | new MainReactPackage(), 31 | new LinearGradientPackage(), 32 | new VectorIconsPackage(), 33 | new RNGestureHandlerPackage() 34 | ); 35 | } 36 | 37 | @Override 38 | protected String getJSMainModuleName() { 39 | return "index"; 40 | } 41 | }; 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | return mReactNativeHost; 46 | } 47 | 48 | @Override 49 | public void onCreate() { 50 | super.onCreate(); 51 | SoLoader.init(this, /* native exopackage */ false); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/screens/Route.js: -------------------------------------------------------------------------------- 1 | import AuthLoading from './AuthLoading'; 2 | import Login from "./Login/" 3 | import Register from "./Register/" 4 | import Home from "./Home/" 5 | import PlayGround from "./PlayGround/" 6 | 7 | import { createStackNavigator, createAppContainer, createSwitchNavigator } from 'react-navigation' 8 | 9 | const AppStack = createStackNavigator( 10 | { 11 | Home: { 12 | screen: Home, 13 | navigationOptions: { gesturesEnabled: true, header: null } 14 | }, 15 | PlayGround: { 16 | screen: PlayGround, 17 | navigationOptions: { gesturesEnabled: true, header: null } 18 | } 19 | }, 20 | { 21 | defaultNavigationOptions: { 22 | initialRouteName: PlayGround, 23 | resetOnBlur: true, 24 | } 25 | } 26 | ); 27 | 28 | const AuthStack = createStackNavigator( 29 | { 30 | Login: { 31 | screen: Login, 32 | navigationOptions: { gesturesEnabled: true, header: null } 33 | }, 34 | Register: { 35 | screen: Register, 36 | navigationOptions: { gesturesEnabled: true, header: null } 37 | } 38 | }, 39 | { 40 | defaultNavigationOptions: { 41 | initialRouteName: Login, 42 | resetOnBlur: true, 43 | } 44 | } 45 | ); 46 | 47 | const AppContainer = createAppContainer(createSwitchNavigator( 48 | { 49 | AuthLoading: AuthLoading, 50 | Auth: AuthStack, 51 | App: AppStack, 52 | }, 53 | { 54 | initialRouteName: 'AuthLoading', 55 | resetOnBlur: true, 56 | } 57 | )); 58 | 59 | export default createAppContainer(AppContainer); -------------------------------------------------------------------------------- /src/library/components/CrossWordCategory.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { View, Text, StyleSheet } from "react-native"; 3 | import { Avatar, Icon } from "react-native-elements"; 4 | 5 | const CrossWordCategory = props => { 6 | return ( 7 | 8 | 9 | 21 | 22 | 23 | {props.title} 24 | 25 | 26 | 27 | 28 | 29 | ); 30 | }; 31 | 32 | const styles = StyleSheet.create({ 33 | categoryContainer: { 34 | flexDirection: "row", 35 | height: 50, 36 | marginHorizontal: 15, 37 | marginBottom: 10, 38 | borderRadius: 30, 39 | borderWidth: 1, 40 | borderColor: "#ddd", 41 | padding: 10 42 | }, 43 | categoryMark: { 44 | flex: 1, 45 | alignItems: "center", 46 | justifyContent: "center" 47 | }, 48 | markIcon: { 49 | backgroundColor: "transparent", 50 | borderWidth: 1, 51 | borderRadius: 100 52 | }, 53 | categoryTitleContainer: { 54 | flex: 5, 55 | justifyContent: "center" 56 | }, 57 | categoryTitle: { 58 | fontSize: 16, 59 | fontWeight: "500", 60 | paddingLeft: 5, 61 | color: "#f0f0f0" 62 | } 63 | }); 64 | 65 | export default CrossWordCategory; -------------------------------------------------------------------------------- /ios/RNcrossword-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ios/RNcrosswordTests/RNcrosswordTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface RNcrosswordTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation RNcrosswordTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 44 | if (level >= RCTLogLevelError) { 45 | redboxError = message; 46 | } 47 | }); 48 | 49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 52 | 53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 55 | return YES; 56 | } 57 | return NO; 58 | }]; 59 | } 60 | 61 | RCTSetLogFunction(RCTDefaultLogFunction); 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /src/redux/actions/places.js: -------------------------------------------------------------------------------- 1 | import { ADD_CROSSWORD, ADD_ANSWERS, GET_CROSSWORD } from './types' 2 | import axios from 'axios' 3 | import URL from '../../Config/URL' 4 | import AsyncStorage from 'react-native' 5 | 6 | 7 | //=========================UNTUK GET LIST CROSSWORD======================= 8 | 9 | export const addCrossword = (payload) => ({ 10 | type : ADD_CROSSWORD, 11 | payload : payload 12 | }) 13 | 14 | 15 | export function fetchData(token) { 16 | return (dispatch) => { 17 | console.log(token); 18 | // token = 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEsImlhdCI6MTU2MjkxODE4NH0.6Y4cl_eFM6yljyWfZNjGWD0WT5TvgdjvvK61lwF4-iM' 19 | 20 | axios.get(`${URL}/crosswords`,{ 21 | headers: { 22 | Authorization: token 23 | } 24 | }).then((res) => { 25 | console.log(res.data.userData); 26 | dispatch({type:"ADD_USER", payload:res.data.userData}) 27 | dispatch(addCrossword(res.data.data)) 28 | }) 29 | .catch((err) => alert(err.response.data.message)) 30 | 31 | 32 | 33 | } 34 | } 35 | 36 | export function fetchAnswer(token) { 37 | return(dispatch) => { 38 | 39 | dispatch({ 40 | type: 'FETCH_ANSWERS', 41 | payload : axios.get(`${URL}/answers`,{ 42 | headers: { 43 | Authorization: token 44 | } 45 | }) 46 | }) 47 | } 48 | } 49 | 50 | //=========================UNTUK GET KOTAK KOTAK======================= 51 | 52 | // export const getQuestion = (id) => ({ 53 | // type : GET_QUESTIONS, 54 | // payload : anjing 55 | // }) 56 | 57 | export function getCrossword(id,token) { 58 | return (dispatch) => { 59 | // axios.get(`${URL}/crosswords/${id}/answers`,{ 60 | // headers: { 61 | // Authorization: token 62 | // } 63 | // }).then((res) => { 64 | // dispatch(getQuestion(res.data.data)) 65 | // }) 66 | // .catch((err) => console.log('err', err.response)) 67 | dispatch({ 68 | type : 'FETCH_QUESTIONS', 69 | payload : axios.get(`${URL}/crosswords/${id}/answers`,{ 70 | headers: { 71 | Authorization: token 72 | } 73 | }) 74 | }) 75 | } 76 | } 77 | 78 | export function storeAnswer(answers){ 79 | dispatch({type: ADD_ANSWERS, payload: answers}) 80 | } 81 | 82 | -------------------------------------------------------------------------------- /ios/RNcrossword/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | RNcrossword 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSLocationWhenInUseUsageDescription 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | NSAppTransportSecurity 44 | 45 | NSAllowsArbitraryLoads 46 | 47 | NSExceptionDomains 48 | 49 | localhost 50 | 51 | NSExceptionAllowsInsecureHTTPLoads 52 | 53 | 54 | 55 | 56 | UIAppFonts 57 | 58 | AntDesign.ttf 59 | Entypo.ttf 60 | EvilIcons.ttf 61 | Feather.ttf 62 | FontAwesome.ttf 63 | FontAwesome5_Brands.ttf 64 | FontAwesome5_Regular.ttf 65 | FontAwesome5_Solid.ttf 66 | Fontisto.ttf 67 | Foundation.ttf 68 | Ionicons.ttf 69 | MaterialCommunityIcons.ttf 70 | MaterialIcons.ttf 71 | Octicons.ttf 72 | SimpleLineIcons.ttf 73 | Zocial.ttf 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /.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 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | 28 | [options] 29 | emoji=true 30 | 31 | esproposal.optional_chaining=enable 32 | esproposal.nullish_coalescing=enable 33 | 34 | module.system=haste 35 | module.system.haste.use_name_reducers=true 36 | # get basename 37 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' 38 | # strip .js or .js.flow suffix 39 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' 40 | # strip .ios suffix 41 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' 42 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' 43 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' 44 | module.system.haste.paths.blacklist=.*/__tests__/.* 45 | module.system.haste.paths.blacklist=.*/__mocks__/.* 46 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* 47 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* 48 | 49 | munge_underscores=true 50 | 51 | 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' 52 | 53 | module.file_ext=.js 54 | module.file_ext=.jsx 55 | module.file_ext=.json 56 | module.file_ext=.native.js 57 | 58 | suppress_type=$FlowIssue 59 | suppress_type=$FlowFixMe 60 | suppress_type=$FlowFixMeProps 61 | suppress_type=$FlowFixMeState 62 | 63 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 64 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 65 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 66 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 67 | 68 | [version] 69 | ^0.92.0 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

:octocat: CrossWords App :octocat:

2 | 3 | ## Table of Contents 4 | 5 | - [Introduction](#introduction) 6 | - [Features](#features) 7 | - [Requirements](#requirements) 8 | - [How to Run](#howtorun) 9 | - [Screenshoots](#screenshoot) 10 | - [Contributors](#contributors) 11 | 12 | ## Introduction 13 | A crossword is a word puzzle that usually takes the form of a square or a rectangular grid of white-and black-shaded squares. The game's goal is to fill the white squares with letters, forming words or phrases, by solving clues, which lead to the answers. 14 | 15 | 16 | ## Features 17 | * User can login/register to start the game 18 | * User can view completed and incompleted game in dashboard 19 | * User get one clue when they start the game. 20 | 21 | ## Requirements 22 | * [`npm`](https://www.npmjs.com/get-npm) 23 | * [`react native`](https://facebook.github.io/react-native) 24 | * [`redux`](https://redux.js.org/) 25 | * [`react navigation`](https://reactnavigation.org/) 26 | * [`API Data`](https://github.com/ihsaninh/crossword-api) 27 | 28 | 29 | ## How To Run 30 | 31 | 1. Clone this repository 32 | ``` 33 | $ git clone https://github.com/ihsaninh/CrossWords-React-Native.git 34 | ``` 35 | 2. Install all depedencies on the package.json 36 | ``` 37 | $ cd CrossWords-React-Native 38 | $ npm install 39 | ``` 40 | 3. Run Application 41 | ``` 42 | $ react-native start 43 | $ react-native run-android or react-native run-ios 44 | ``` 45 | ## Screenshoot 46 |
47 | 48 | 49 | 50 | 51 |
52 | 53 | 54 | ## Contributors 55 |
56 | 57 | 58 | 64 | 70 | 76 | 82 | 83 |
59 | 60 | Achlan Bima
61 | Achlan Bima 62 |
63 |
65 | 66 | Azizi Mukmin
67 | Azizi Mukmin 68 |
69 |
71 | 72 | Ihsan Nurul Habib
73 | Ihsan Nurul Habib 74 |
75 |
77 | 78 | Riswan Ardiansyah
79 | Riswan Ardiansyah 80 |
81 |
84 |
85 | 86 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /ios/RNcrossword/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/redux/reducers/reducers.js: -------------------------------------------------------------------------------- 1 | import { ADD_CROSSWORD, GET_CROSSWORD, ADD_ANSWERS } from '../actions/types' 2 | 3 | const initialState = { 4 | places : { 5 | places: [] 6 | }, 7 | answers: [], 8 | finishCond: [], 9 | crosswords: [], 10 | user: {}, 11 | questions: [], 12 | fetching:false, 13 | fetched:false, 14 | error:null, 15 | 16 | }; 17 | 18 | const reducer = (state = initialState, action) => { 19 | switch(action.type) { 20 | case ADD_CROSSWORD: 21 | state = { 22 | ...state, 23 | crosswords: state.crosswords.concat(action.payload) 24 | } 25 | return state 26 | break 27 | 28 | case 'FETCH_QUESTIONS_PENDING': 29 | state = { 30 | ...state, fetching:true 31 | } 32 | return state 33 | break 34 | 35 | case 'FETCH_QUESTIONS_FULFILLED': 36 | state = { 37 | ...state, fetching:false, fetched:true, questions: action.payload.data.data 38 | } 39 | return state 40 | break 41 | 42 | case 'FETCH_QUESTIONS_REJECTED': 43 | state = { 44 | ...state, fetching:false, error: action.payload 45 | } 46 | return state 47 | break 48 | 49 | case 'FETCH_ANSWERS_PENDING': 50 | state = { 51 | ...state, fetching:true 52 | } 53 | return state 54 | break 55 | 56 | case 'FETCH_ANSWERS_FULFILLED': 57 | state = { 58 | ...state, fetching:false, fetched:true, answers: action.payload.data.data 59 | } 60 | return state 61 | break 62 | 63 | case 'FETCH_ANSWERS_REJECTED': 64 | state = { 65 | ...state, fetching:false, error: action.payload 66 | } 67 | return state 68 | break 69 | 70 | // case GET_QUESTIONS: 71 | // state = { 72 | // ...state, 73 | // questions: {answers:action.payload.answers, availableIndexes: action.payload.availableIndexes} 74 | // } 75 | // return state 76 | 77 | case "ADD_USER": 78 | 79 | state = { 80 | ...state, 81 | user: {id:action.payload.id,username:action.payload.username} 82 | } 83 | return state 84 | 85 | case "ADD_ANSWERS": 86 | console.log("Leng "+state.answers.length); 87 | // if(state.answers.length!=0){ 88 | 89 | // for(let i=0; i 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/RNcrossword.xcodeproj/xcshareddata/xcschemes/RNcrossword-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /src/screens/Home/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import axios from 'axios' 3 | import URL from '../../Config/URL' 4 | import { connect } from 'react-redux' 5 | import { addPlace } from '../../redux/actions/places' 6 | import { StyleSheet, View, Text, AsyncStorage, Image, ScrollView, StatusBar, Alert, TouchableOpacity } from 'react-native' 7 | import { Icon } from 'react-native-elements' 8 | import LinearGradient from 'react-native-linear-gradient' 9 | import CrossWordCategory from '../../library/components/CrossWordCategory' 10 | 11 | class index extends Component { 12 | 13 | constructor(props) { 14 | super(props) 15 | this.state = { 16 | data: [], 17 | user: '' 18 | } 19 | } 20 | 21 | componentDidMount() { 22 | this.getData() 23 | const { navigation } = this.props; 24 | this.focusListener = navigation.addListener('didFocus', () => { 25 | this.getData() 26 | }); 27 | } 28 | 29 | componentWillUnmount() { 30 | this.focusListener.remove(); 31 | } 32 | 33 | async getData() { 34 | const token = await AsyncStorage.getItem('token') 35 | 36 | axios.get(`${URL}/crosswords`, { 37 | headers: { 38 | Authorization: token 39 | } 40 | }).then(res => { 41 | if (res.status === 200) { 42 | this.setState({ 43 | data: res.data.data, 44 | user: res.data.userData.username 45 | }) 46 | } 47 | }).catch((err) => alert(err.response.data.message)) 48 | } 49 | 50 | playGround(id, column, userId) { 51 | this.props.navigation.navigate('PlayGround', { 52 | id: id, 53 | column: column, 54 | userId 55 | }) 56 | } 57 | 58 | logoutConfirm = () => { 59 | AsyncStorage.removeItem('token') 60 | this.props.navigation.navigate('AuthLoading') 61 | } 62 | 63 | handleLogout = () => { 64 | Alert.alert( 65 | 'Konfirmasi Keluar', 66 | 'Yakin mau Keluar?', 67 | [ 68 | { 69 | text: 'Cancel', 70 | onPress: () => console.log('Cancel Pressed'), 71 | style: 'cancel', 72 | }, 73 | { 74 | text: 'OK', onPress: this.logoutConfirm 75 | }, 76 | ], 77 | { cancelable: false }, 78 | ); 79 | } 80 | 81 | render() { 82 | const list = this.state.data 83 | return ( 84 | 85 | 86 | 87 | 88 | Dashboard User 89 | 90 | 91 | 93 | 94 | 95 | 96 | 97 | 98 | 102 | {this.state.user} 103 | Newbie Level 1 104 | 105 | 106 | 107 | Pilihan Kategori 108 | 109 | { 110 | list.map((category, i) => ( 111 | this.playGround(category.id, category.total_column, category.user_crossword[0].user_id)}> 112 | 113 | 114 | )) 115 | } 116 | 117 | 118 | 119 | 120 | ); 121 | } 122 | } 123 | 124 | const styles = StyleSheet.create({ 125 | container: { 126 | flex: 1, 127 | }, 128 | authorContainer: { 129 | flex: 3 130 | }, 131 | authorWrapper: { 132 | margin: 20, 133 | alignItems: 'center', 134 | justifyContent: 'center', 135 | marginTop: 20, 136 | borderBottomWidth: 1, 137 | borderBottomColor: '#ddd', 138 | paddingBottom: 20 139 | }, 140 | authorName: { 141 | fontSize: 22, 142 | paddingTop: 10, 143 | fontWeight: '500', 144 | color: '#f0f0f0' 145 | }, 146 | authorInfo: { 147 | fontSize: 16, 148 | paddingTop: 5, 149 | color: '#f0f0f0' 150 | }, 151 | categoryContainer: { 152 | flex: 5 153 | }, 154 | gradientStyle: { 155 | flex: 1 156 | }, 157 | topDashboardContainer: { 158 | flex: 0.5, 159 | flexDirection: 'row', 160 | justifyContent: 'center', 161 | alignItems: 'center', 162 | marginTop: 5 163 | }, 164 | topDashboardTitle: { 165 | fontSize: 21, 166 | fontWeight: '500', 167 | color: '#f0f0f0' 168 | }, 169 | authorAvatar: { 170 | width: 60, 171 | height: 60, 172 | borderRadius: 100 173 | }, 174 | categoryChoose: { 175 | fontSize: 16, 176 | color: '#f0f0f0', 177 | paddingLeft: 30, 178 | paddingBottom: 10, 179 | fontWeight: '500', 180 | marginTop: -10 181 | } 182 | }); 183 | 184 | 185 | const mapStateToProps = (state) => ({ 186 | finishCond: state.reducers.finishCond 187 | }) 188 | 189 | export default connect(mapStateToProps)(index) -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion rootProject.ext.compileSdkVersion 98 | 99 | compileOptions { 100 | sourceCompatibility JavaVersion.VERSION_1_8 101 | targetCompatibility JavaVersion.VERSION_1_8 102 | } 103 | 104 | defaultConfig { 105 | applicationId "com.rncrossword" 106 | minSdkVersion rootProject.ext.minSdkVersion 107 | targetSdkVersion rootProject.ext.targetSdkVersion 108 | versionCode 1 109 | versionName "1.0" 110 | } 111 | splits { 112 | abi { 113 | reset() 114 | enable enableSeparateBuildPerCPUArchitecture 115 | universalApk false // If true, also generate a universal APK 116 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 117 | } 118 | } 119 | buildTypes { 120 | release { 121 | minifyEnabled enableProguardInReleaseBuilds 122 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 123 | } 124 | } 125 | // applicationVariants are e.g. debug, release 126 | applicationVariants.all { variant -> 127 | variant.outputs.each { output -> 128 | // For each separate APK per architecture, set a unique version code as described here: 129 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 130 | def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4] 131 | def abi = output.getFilter(OutputFile.ABI) 132 | if (abi != null) { // null for the universal-debug, universal-release variants 133 | output.versionCodeOverride = 134 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 135 | } 136 | } 137 | } 138 | } 139 | 140 | dependencies { 141 | implementation project(':react-native-linear-gradient') 142 | implementation project(':react-native-vector-icons') 143 | implementation project(':react-native-gesture-handler') 144 | implementation fileTree(dir: "libs", include: ["*.jar"]) 145 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 146 | implementation "com.facebook.react:react-native:+" // From node_modules 147 | implementation project(':react-native-linear-gradient') 148 | // implementation project(':react-native-svg') 149 | } 150 | 151 | // Run this once to be able to run the application with BUCK 152 | // puts all compile dependencies into folder libs for BUCK to use 153 | task copyDownloadableDepsToLibs(type: Copy) { 154 | from configurations.compile 155 | into 'libs' 156 | } 157 | -------------------------------------------------------------------------------- /src/screens/Login/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { StyleSheet, View, Text, AsyncStorage, TextInput, StatusBar, Keyboard, ActivityIndicator } from 'react-native' 3 | import { Button } from 'react-native-elements' 4 | import { Icon } from 'react-native-elements' 5 | import LinearGradient from 'react-native-linear-gradient' 6 | import axios from "axios"; 7 | import URL from '../../Config/URL' 8 | 9 | class Index extends Component { 10 | constructor(props) { 11 | super(props) 12 | 13 | this.state = { 14 | inputEmail: '', 15 | inputPassword: '', 16 | focused: false, 17 | isLoading: false 18 | } 19 | } 20 | 21 | handleLogin = () => { 22 | email = this.state.inputEmail 23 | password = this.state.inputPassword 24 | if (email == "" || password == "") { 25 | alert('Email/ Password Tidak Boleh Kosong!') 26 | } else { 27 | this.setState({ isLoading: true }) 28 | axios 29 | .post(`${URL}/login`, { 30 | email: this.state.inputEmail, 31 | password: this.state.inputPassword 32 | }) 33 | .then(res => { 34 | const token = res.data; 35 | AsyncStorage.setItem('token', `${res.data.token.type} ${res.data.token.token}`) 36 | .then((res) => { 37 | console.log(res); 38 | this.props.navigation.navigate('App'); 39 | this.setState({ isLoading: false }) 40 | }).catch(err => alert('token failed')) 41 | AsyncStorage.setItem("token", token); 42 | this.setState({ isLoading: false }) 43 | this.props.navigation.navigate('App'); 44 | }) 45 | .catch(err => { 46 | this.setState({ isLoading: false }) 47 | alert(err.response.data.message) 48 | }); 49 | } 50 | } 51 | 52 | async componentDidMount() { 53 | const token = await AsyncStorage.getItem("token"); 54 | if (token !== null) { 55 | this.props.navigation.navigate("RoomChat"); 56 | } 57 | this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.keyboardDidHide); 58 | } 59 | 60 | componentWillUnmount() { 61 | this.keyboardDidHideListener.remove(); 62 | } 63 | 64 | onFocusChange = () => { 65 | this.setState({ 66 | focused: true 67 | }); 68 | } 69 | 70 | keyboardDidHide = () => { 71 | Keyboard.dismiss(); 72 | this.setState({ 73 | focused: false 74 | }) 75 | } 76 | 77 | render() { 78 | if (this.state.isLoading) { 79 | return ( 80 | 81 | 82 | 83 | 84 | Please wait.. 85 | 86 | 87 | ) 88 | } else { 89 | return ( 90 | 91 | 92 | 96 | 97 | 98 | 104 | 113 | CrossWords 114 | 115 | 116 | 117 | 118 | 134 | this.setState({ inputEmail }) 135 | } 136 | /> 137 | 154 | this.setState({ inputPassword }) 155 | } 156 | secureTextEntry={true} 157 | /> 158 |