Skip to content

Commit

Permalink
fix TouchableOpacity example scren
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanshar committed Dec 17, 2019
1 parent 5b9c101 commit c2b3d7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 40 deletions.
11 changes: 5 additions & 6 deletions demo/src/screens/PlaygroundScreen.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import _ from 'lodash';
import React, {Component} from 'react';
import {StyleSheet} from 'react-native';
import {View, Text} from 'react-native-ui-lib'; //eslint-disable-line

import {View, Text, Card} from 'react-native-ui-lib'; //eslint-disable-line

export default class PlaygroundScreen extends Component {

render() {
return (
<View center bg-dark80 flex>
<Text text50>Playground Screen</Text>
<Card height={100} center padding-20>
<Text text50>Playground Screen</Text>
</Card>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
}
container: {}
});
43 changes: 9 additions & 34 deletions demo/src/screens/wrapperScreens/TouchableOpacityScreen.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
import React, { Component } from 'react';
import React, {Component} from 'react';
import {View, Text, TouchableOpacity} from 'react-native-ui-lib'; //eslint-disable-line

export default class TouchableOpacityScreen extends Component {

state = {
count: 0,
}

componentDidMount() {
const snippet = this.example.getSnippet();
this.setState({
snippet,
});
}
count: 0
};

count() {
this.setState({
count: this.state.count + 1,
count: this.state.count + 1
});
}

Expand All @@ -25,33 +17,16 @@ export default class TouchableOpacityScreen extends Component {
<View flex bg-dark70 useSafeArea>
<View flex center>
<View marginB-20>
<Text center>
TouchableOpacity with support for throttling.
</Text>
<Text center>
In this example, throttleTime is set to 1200
</Text>
<Text center>TouchableOpacity with support for throttling.</Text>
<Text center>In this example, throttleTime is set to 1200</Text>
</View>
<TouchableOpacity
throttleTime={1200}
onPress={() => this.count()}
ref={element => this.example = element}
>
<Text text40>
Click Me!
</Text>
<TouchableOpacity throttleTime={1200} onPress={() => this.count()} ref={element => (this.example = element)}>
<Text text40>Click Me!</Text>
</TouchableOpacity>
<View center marginT-20>
<Text text20>
{this.state.count}
</Text>
<Text text20>{this.state.count}</Text>
</View>
</View>
<View bg-dark10 margin-10 padding-10>
<Text white>
{this.state.snippet}
</Text>
</View>
</View>
);
}
Expand Down

0 comments on commit c2b3d7d

Please sign in to comment.