Skip to content

Instantly share code, notes, and snippets.

View abhitheawesomecoder's full-sized avatar

Abhishek Kumar abhitheawesomecoder

View GitHub Profile
@abhitheawesomecoder
abhitheawesomecoder / gist:a1aaae61d3649c75105b140abb3d546e
Created July 8, 2017 06:57
How to add Animated Modal to your React Native App
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
Button
} from 'react-native';
import Modal from 'react-native-modal'
import Sequelize from 'sequelize';
import casual from 'casual';
import _ from 'lodash';
import bcrypt from 'bcrypt';
const password = "test123"
const db = new Sequelize('blog', null, null, {
dialect: 'sqlite',
storage: './blog.sqlite',
});
import { User } from './connectors';
import bcrypt from 'bcrypt';
import jwt from 'jsonwebtoken';
import Constants from '../constants';
const resolvers = {
Query: {
user(_, args) {
return User.find({ where: args });
},
import {
makeExecutableSchema,
addMockFunctionsToSchema,
} from 'graphql-tools';
import resolvers from './resolvers';
const typeDefs = `
type User {
id: Int
import express from 'express';
import { graphqlExpress, graphiqlExpress } from 'apollo-server-express';
import bodyParser from 'body-parser';
import schema from './data/schema';
import cors from 'cors';
import jwt from 'express-jwt';
import Constants from './constants';
import { User } from './data/connectors';
const GRAPHQL_PORT = 4000;
const Constants = {
SECRET: 'iloveyou'
}
export default Constants
import React from 'react'
import { AsyncStorage } from 'react-native';
import { ApolloProvider, createNetworkInterface, ApolloClient } from 'react-apollo'
import Mainuser from './components/mainuser'
import Login from './components/Login'
import Register from './components/Register'
const networkInterface = createNetworkInterface({ uri: 'http://192.168.1.3:4000/graphql'
})
import React, { Component } from 'react';
import { StyleSheet, Text, View, Button, DatePickerAndroid, TimePickerAndroid, Picker, AppRegistry, TouchableOpacity } from 'react-native';
//import AvailableDates from '../Calendar/Calendar';
//import { Calendar, CalendarList } from 'react-native-calendars';
let arrBooked = []
const availableHours = {
"timeSlots": {
"slot1": "2:00pm to 2:30pm",
import React from 'react';
import { View, Text } from 'react-native';
import { createStackNavigator } from 'react-navigation';
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
</View>
import React from 'react';
import { View, Text } from 'react-native';
export default class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
</View>
);