Browse Source

auto commit

app
jfinn 3 years ago
parent
commit
685ff418a2
2 changed files with 48 additions and 0 deletions
  1. 29
    0
      mdev/Btn.js
  2. 19
    0
      mdev/Desc.js

+ 29
- 0
mdev/Btn.js View File

1
+//@flow
2
+import React, { Component } from 'react';
3
+import { Text, TouchableOpacity, StyleSheet } from 'react-native';
4
+
5
+const styles = StyleSheet.create({
6
+  root: {
7
+    margin: 3,
8
+    paddingVertical: 4,
9
+    paddingHorizontal: 8,
10
+    color: '#36f',
11
+    borderWidth: 1,
12
+    borderColor: '#36f',
13
+    fontSize: 12,
14
+  },
15
+});
16
+
17
+export default class Btn extends Component<{
18
+  onPress: () => void,
19
+  label: string,
20
+}> {
21
+  render() {
22
+    const { onPress, label } = this.props;
23
+    return (
24
+      <TouchableOpacity onPress={onPress}>
25
+        <Text style={styles.root}>{label}</Text>
26
+      </TouchableOpacity>
27
+    );
28
+  }
29
+}

+ 19
- 0
mdev/Desc.js View File

1
+//@flow
2
+import React from 'react';
3
+import { StyleSheet, Text } from 'react-native';
4
+
5
+const styles = StyleSheet.create({
6
+  desc: {
7
+    marginHorizontal: 10,
8
+    marginVertical: 20,
9
+    fontSize: 14,
10
+    fontStyle: 'italic',
11
+    color: '#888',
12
+  },
13
+});
14
+
15
+const Desc = ({ desc }: { desc: string }) => {
16
+  return <Text style={styles.desc}>{desc}</Text>;
17
+};
18
+
19
+export default Desc;

Loading…
Cancel
Save