Skip to content

Instantly share code, notes, and snippets.

View hungdev's full-sized avatar
💭
I may be slow to respond.

Hung Vu hungdev

💭
I may be slow to respond.
View GitHub Profile
import React, { PureComponent } from 'react';
import { View, Text, NetInfo, Dimensions, StyleSheet } from 'react-native';
const { width } = Dimensions.get('window');
function MiniOfflineSign() {
return (
<View style={styles.offlineContainer}>
<Text style={styles.offlineText}>No Internet Connection</Text>
</View>
@hungdev
hungdev / Map.md
Last active July 26, 2018 11:10
Map
import React from 'react'
import { View, TouchableOpacity, Text, BackHandler } from 'react-native'
import MapView, { Callout } from 'react-native-maps'
import { connect } from 'react-redux'
//action
import { getAgentLocation } from '../../actions/Map'

import { MapCallout, CustomNavbar } from '../../components'
import styles from './styles'
@hungdev
hungdev / Scroll to index Flatlist example.md
Created July 20, 2018 16:57
Scroll to index Flatlist example
import React, { Component } from 'react';
import { Text, View, FlatList, Dimensions, Button, StyleSheet } from 'react-native';

const { width } = Dimensions.get('window');

const style = {
  justifyContent: 'center',
  alignItems: 'center',
  width: width,
@hungdev
hungdev / Create array from number.md
Last active August 22, 2019 08:12
Create array from number
@hungdev
hungdev / hide_tabbar_in_stack.md
Created July 14, 2018 18:23
hide tabbar in stack
@hungdev
hungdev / react-native-scrollable-tab-view.md
Created July 13, 2018 13:52
react-native-scrollable-tab-view custom
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import {
  StyleSheet,
  Text,
  View,
  TouchableOpacity,
  Image
} from 'react-native'
@hungdev
hungdev / Confic react-native-maps and react-native-charts-wrapper.md
Last active June 13, 2018 13:41
Confic react-native-maps and react-native-charts-wrapper

Do the following to fix this collisions: react-native-maps/react-native-maps#1615 (comment)

Go to the node_modules/react-native-charts-wrapper/iOS
Run: grep -rn “onSelect” .
Replace all instances found of onSelect with onChartSelect
Go to the node_modules/react-native-charts-wrapper/lib
Run: grep -rn “onSelect” .

Replace all instances found of onSelect with onChartSelect

/* @flow */
const defaultDiacriticsRemovalMap = [{
'base': 'A',
'letters': '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F'
}, {
'base': 'AA',
'letters': '\uA732'
}, {
'base': 'AE',
'letters': '\u00C6\u01FC\u01E2'
@hungdev
hungdev / Metrics.md
Created June 4, 2018 15:19
Metrics
import {Dimensions, Platform, StatusBar} from 'react-native'
import color from 'color'
import Colors from './Colors'
import { isIphoneX } from 'react-native-iphone-x-helper'

const { width, height } = Dimensions.get('window')
const ASPECT_RATIO = width / height
const LATITUDE_DELTA = 0.0922
const platform = Platform.OS