Skip to content

Instantly share code, notes, and snippets.

View nicholasess's full-sized avatar
🎯
Focusing

Nicholas Eduardo nicholasess

🎯
Focusing
View GitHub Profile
import React from "react";
import { asyncComponent } from "@jaredpalmer/after";
export default [
{
path: "/",
exact: true,
component: asyncComponent({
loader: () => import("./Home"), // required
const { exec } = require("child_process");
exec("node teste.js", (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
const ViewContainer = ({children, style}) =>
Platform.OS == "ios" ? <Keyboard style={style} behavior="padding">{children}</Keyboard> :
<Keyboard style={style} behavior="position">{children}</Keyboard>
<ViewContainer>
<View> </View>
</ViewContainer>
export default class App extends Component {
state = {
data: data
}
renderItem = ({item}) => {
return (<View>
<Image source={{uri: item.avatar}} style={styles.itemImage} />
</View>)
}
import React, { Component } from 'react';
import { View, StyleSheet, Dimensions, FlatList, Image } from 'react-native';
import data from './data'
let {width} = Dimensions.get('window')
let numberGrid = 3
let itemWidth = width / numberGrid
export default [{
id: 1,
first_name: "George",
last_name: "Bluth",
avatar: "https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg"
},
{
id: 2,
first_name: "Janet",
last_name: "Weaver",
const styles = StyleSheet.create({
container: {
flex: 1,
},
itemImage:{
width: itemWidth,
height: itemWidth
}
});
const Settings = StackNavigator({
Notification: {screen: NotificationScreen},
SocialMedia: {screen: SocialMediaScreen}
})
export default StackNavigator({
Home: {screen: HomeScreen},
Settings: {screen: Settings}
})
@nicholasess
nicholasess / index.js
Created December 8, 2017 16:00
example
class App extends Component {
constructor(){
this.state = {loading: true}
}
componentWillMount(){
FCMToken(token){
this.setState({token: token, loading: false})
}
}
render(){
@nicholasess
nicholasess / content.js
Created October 10, 2017 14:27
snapshot
const Content = ({ content, handleVote}) => (
<Container>
<Info>
<Thumb
style={{
backgroundImage: `url(${changeImage.imageFromContent(
content.img_130
)})`
}}
/>