-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Footer.js
47 lines (39 loc) · 1.21 KB
/
Footer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2018, Amaury Martiny and the Shoot! I Smoke contributors
// SPDX-License-Identifier: GPL-3.0
import React, { PureComponent } from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { About } from '../../Screens/About';
import * as theme from '../../utils/theme';
export class Footer extends PureComponent {
static defaultProps = {
text: 'Click to understand how we did the math.'
};
state = {
isAboutVisible: false
};
handleAboutHide = () => this.setState({ isAboutVisible: false });
handleAboutShow = () => this.setState({ isAboutVisible: true });
render() {
const { style, text } = this.props;
const { isAboutVisible } = this.state;
return (
<View style={[styles.container, style]}>
<TouchableOpacity onPress={this.handleAboutShow}>
<Text style={styles.link}>{text}</Text>
</TouchableOpacity>
<About onRequestClose={this.handleAboutHide} visible={isAboutVisible} />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
marginBottom: theme.defaultSpacing,
marginTop: theme.defaultSpacing
},
link: {
...theme.text,
...theme.link,
fontSize: 13
}
});