Skip to content

Instantly share code, notes, and snippets.

View kaueDM's full-sized avatar

Kauê kaueDM

View GitHub Profile
import firebase from 'firebase';
import cfg from '../cfg';
import { GET_CONTRIBUTIONS } from './types';
const firebaseTimeline = firebase.initializeApp(cfg, 'firebaseTimeline');
export const getContributions = (location) => {
return (dispatch) => {
firebaseTimeline.database().ref(`/prod/city-occurrences/${location}`)
.on('value', citySnap => {
import React, { Component } from 'react';
import { Text } from 'native-base';
import { StackNavigator, TabNavigator, TabBarTop } from 'react-navigation';
import Login from '../components/Login';
import Home from '../components/Home';
import Works from '../components/Works';
import TaskList from '../components/TaskList';
import Task from '../components/Task';
Setting a timer for a long period of time, i.e. multiple minutes,
is a performance and correctness issue on Android as it keeps the
timer module awake, and timers can only be called when the app is
in the foreground. See https://github.com/facebook/react-native/issues/12981
for more info.
(Saw setTimeout with duration 507914ms)
import React, { Component } from 'react';
import { Text } from 'native-base';
import { StackNavigator, TabNavigator, TabBarTop } from 'react-navigation';
import Login from '../components/Login.component';
import WorkList from '../components/WorkList.component';
import TaskList from '../components/TaskList.component';
import Timer from '../components/Timer.component';
const tabs = TabNavigator({
@kaueDM
kaueDM / why.js
Created September 27, 2017 19:00
//Home.js
<Tab heading="TAREFAS"
tabStyle={{ backgroundColor: BLUE }}
textStyle={{ color: WHITE }}
activeTabStyle={{ backgroundColor: BLUE }}
activeTextStyle={{ color: WHITE, fontWeight: '900' }}
>
<TaskList navigate={this.props.navigation.navigate} />
</Tab>
`ScrollView` has no propType for native prop `RCTScrollView.contentInsetAdjustmentBehavior` of native type `UIScrollViewContentInsetAdjustmentBehavior`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
verifyPropTypes
verifyPropTypes.js:67:22
requireNativeComponent
requireNativeComponent.js:108:6
<unknown>
ScrollView.js:835:4
loadModuleImplementation
const getList = (employeeUID) => {
let result = {};
const ref = database.ref('employee_works').child(employeeUID).orderByValue().equalTo(true);
return new Promise((resolve, reject) => {
ref.once('value')
.then(workUIDs => {
if (workUIDs.val()) {
Object.keys(workUIDs.val()).map(item => {
database.ref('works').child(item).once('value')
.then(workDetails => result[item] = workDetails.val())
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { BrowserRouter as Router, Switch, Route, Redirect } from 'react-router-dom';
import { auth } from '../services/firebase';
import {
Login,
Home,
E404,
<select
value={this.state.customer ? this.state.customer : 'Selecione...'}
onChange={e => this._handleSelect(e)}
>
{_.map(this.state.customerOptions, item => {
return (
<option key={item.uid} value={item.uid}> {item.company ? item.company : item.name} </option>
)
})}
</select>
<Router>
<Switch>
<Route exact path='/' component={Login} />
<Home>
<Switch>
<Route exact path="/dashboard" component={Dashboard} />
<Route exact path="/tarefas" component={Tasks} />
<Route exact path="/usuarios" component={Users} />
<Route exact path="/perfil/:uid" component={Profile} />