Skip to content

Instantly share code, notes, and snippets.

Mario mariodev12

Block or report user

Report or block mariodev12

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View gist:5b582f6d91f61393cf3f0f29052b817c
[
{
"key":1,
"name":"Suits",
"image":"https://static.tvmaze.com/uploads/images/medium_portrait/0/2432.jpg"
},
{
"key":2,
"name":"Modern Family",
"image":"https://static.tvmaze.com/uploads/images/medium_portrait/0/628.jpg"
View gist:1fbcd7e115d56313e3fabac93eaa84b5
import React, { Component } from 'react';
import Video from 'react-native-video';
import {
TouchableWithoutFeedback,
TouchableHighlight,
PanResponder,
StyleSheet,
Touchable,
Animated,
Easing,
View superheroes.json
[
{
"superhero":"Batman",
"publisher":"DC Comics",
"alter_ego":"Bruce Wayne",
"first_appearance":"Detective Comics #27",
"characters":"Bruce Wayne"
},
{
"superhero":"Superman",
View gist:278920cc1e354a97023eac8bdf8fd2b6
<TextInput
style={styles.textInput}
onChangeText={(text) => this.filterSearch(text)}
value={this.state.text}
/>
View gist:b5d79bcf49c6c10b03aa4fbd7ddbcb1c
filterSearch(text){
this.setState({text})
let newData = this.dataFilter(text, this.state.rawData);
this.setState({
dataSource: this.state.dataSource.cloneWithRows(newData),
isLoaded: true,
empty: false
})
}
View gist:1cd35a856ec272e8e61970156740c721
renderRow(rowData){
return (
<TouchableHighlight style={styles.containerCell}>
<View>
<View style={styles.footerContainer}>
<View style={styles.footerTextContainer}>
<Text style={styles.text}>{rowData.name}</Text>
<Text style={[styles.text, styles.textTitle]}>{rowData.number}</Text>
<Text style={[styles.text, styles.textBy]}>By {rowData.airdate}</Text>
</View>
View gist:6c743f0b51eba63cc14ab4295877c8ba
<ListView
enableEmptySections={true}
renderRow={this.renderRow.bind(this)}
dataSource={this.state.dataSource}
/>
View gist:18f82e0a91f2f214621c7f1345a6a320
export default class App extends Component {
constructor(){
super()
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
this.state = {
dataSource: ds.cloneWithRows([]),
rawData: ''
}
}
View App.js
import React, {Component} from 'react'
import { Text, InputText, View, StyleSheet, Dimensions } from 'react-native'
const {width, height} = Dimensions.get('window')
export default class App extends Component {
render(){
<View style={styles.container}>
<InputText
style={styles.inputText}
You can’t perform that action at this time.