Skip to content

Instantly share code, notes, and snippets.

@faustoct
faustoct / UsageProxySnippet.js
Last active May 14, 2019
Exemplo de uso do proxy
View UsageProxySnippet.js
<TouchableOpacity onPress={()=>{Views.navigator.navigate({
routeName: 'Proxy',
params: {component:'List', title: 'Curtidas'},
key: Backend.uuid() })}}>
<Text style={{fontSize: 16, margin:10}}>Curtidas</Text>
</TouchableOpacity>
View List
import React, { Component } from 'react';
import { FlatList, View, Text } from 'react-native';
class List extends Component {
/*
essa abordagem ajuda carregar componentes mais rapido de forma async ao msm tempo q List inicializa :)
*/
initAsync = async () => {
}
View Views.js
import React, { Component, View, ScrollView, Text } from 'react';
import { createBottomTabNavigator, createStackNavigator, createAppContainer, StackActions, NavigationActions } from 'react-navigation';
import { Constants } from 'react-native-unimodules'
import Splash from './../views/Splash.js'
import Login from './../views/Login.js'
import CodeConfirmation from './../views/CodeConfirmation.js'
import Share from './../views/Share.js'
import Content from './../views/Content.js'
import Main from './../views/Main.js'
@faustoct
faustoct / Proxy.js
Last active May 14, 2019
proxy interface to react-native-navigation
View Proxy.js
import React, { Component } from 'react';
let Current=null
class Proxy extends Component {
static navigationOptions = ({ navigation, navigationOptions }) => {
const { params } = navigation.state;
return {
title: params.title,
headerStyle: { backgroundColor: '#fff' },
View main.rb
#Analyze image
media = "https://i.ytimg.com/vi/DGU1awKrNiA/hqdefault.jpg"
params = {
"requests":
[
{
"features":
[
{ "maxResults": 50, "type": "TEXT_DETECTION" },
],