Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { StyleSheet, View, Alert } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';
import {
Container,
Content,
Icon,
@Ayyagaries
Ayyagaries / reducer.js
Created April 17, 2018 05:04
Reducer Code
import {
REQUEST_REP_SEARCH,
SUCCESS_REP_SEARCH,
RESET_DATA,
SHOW_ALERT,
} from '../actions/searchReps';
const intitalState = {
showLoading: false,
repsFound: [],
@Ayyagaries
Ayyagaries / file.js
Created April 16, 2018 19:36
Component
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { StyleSheet, View } from 'react-native';
import {
Container,
Content,
Icon,
Item,
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.apicall.testapp.MainActivity">
<TextView
android:layout_width="wrap_content"
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.apicall.testapp"
minSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
package com.example.apicall.testapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import org.json.JSONException;
@Ayyagaries
Ayyagaries / AndroidManifestFile
Created April 16, 2018 17:49
AndroidManifestFile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.apicall.testapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@Ayyagaries
Ayyagaries / routes.js
Created April 10, 2018 14:13
Using react navigation
import React from 'react';
import { Button, Icon } from 'native-base';
import { StackNavigator, DrawerNavigator } from 'react-navigation';
import { Animated, Easing } from 'react-native';
// import NewPassword from '../screens/NewPassword';
import Login from '../screens/Login';
import Home from '../screens/HomeScreen';
import DrawerContainer from '../components/Drawer/DrawerComponent';
import ForgotPassword from '../screens/ForgotPassword';
@Ayyagaries
Ayyagaries / List.js
Created April 6, 2018 19:33
ListComponent
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { StyleSheet, View, FlatList, TextInput, TouchableHighlight } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { Container, Content, Text, Button, Label, Item, Input } from 'native-base';
import Spinner from 'react-native-loading-spinner-overlay';
import { requestAttachedFacilities, seletedFacility } from '../actions/pickFacility';
@Ayyagaries
Ayyagaries / component.js
Created April 5, 2018 17:59
Look for headerWithSearchText,fliterList() and render method
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { StyleSheet, View, FlatList, TextInput } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { Container, Content, Text, Button, Label, Header, Item, Input } from 'native-base';
import Spinner from 'react-native-loading-spinner-overlay';
import { requestAttachedFacilities } from '../actions/pickFacility';