Skip to content

Instantly share code, notes, and snippets.

View hanipcode's full-sized avatar
🎯
Focusing

Muhammad Hanif hanipcode

🎯
Focusing
View GitHub Profile
import React, { Component } from 'react';
import {
View,
Text,
FlatList,
StyleSheet,
TouchableHighlight
} from 'react-native';
// .. rest of code
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import AutoCompleteBox from '../components/AutoCompleteBox';
import AutoCompleteResultList from '../components/AutoCompleteResultList';
import { getPredictionWithDetail } from '../services.js';
const KEY = 'Y_API_KEY';
class SearchBox extends Component {
constructor(props) {
import React, { Component } from 'react';
import { View } from 'react-native';
import SearchBox from './SearchBox';
class PickupPage extends Component {
constructor(props) {
super(props);
this.state = {
pickupCoordinate: null,
dropCoordinate: null
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Pickup from './src/containers/PickupPage';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Pickup />
</View>
//rest of code
const styles = StyleSheet.create({
FloatingContainer: {
position: 'absolute',
alignSelf: 'stretch',
top: 55,
left: 0,
right: 0,
marginHorizontal: 22,
borderWidth: 2,
import React, { Component } from 'react';
import { View, Alert } from 'react-native';
import { MapView } from 'expo';
class PickupMapView extends Component {
render() {
console.log(this.state);
return (
<MapView
style={{ flex: 1 }}
import React, { Component } from 'react';
import { View } from 'react-native';
import SearchBox from './SearchBox';
import PickupMapView from './PickupMapView';
class PickupPage extends Component {
constructor(props) {
super(props);
this.state = {
pickupCoordinate: null,
//rest of package.json
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"spec":
"jest --testPathPattern helpers.spec.js --testPathIgnorePatterns node_modules"
},
//rest of package.json
"jest": {
"preset": "react-native",
import MyService from './api';
const service = new MyService();
describe('MY API Service', () => {
let data;
beforeEach(async () => {
const currentUser = {
firstName: 'My',
lastName: 'Name',
@hanipcode
hanipcode / menu.js
Created January 10, 2018 04:06
menu animation react native
import React from 'react';
import { View, Image, Text, Animated, TouchableOpacity } from 'react-native';
import PropTypes from 'prop-types';
import assets from '../assets';
import styles from '../styles';
class HomeTabBar extends React.Component {
constructor(props) {
super(props);
this.state = {