Skip to content

Commit e4cfe4c

Browse files
committed
🔥 [misc] v0.1.10 fix some type error
1 parent b716fb6 commit e4cfe4c

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trpg-game-client",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "专注于TRPG跑团的IM即时应用聊天软件",
55
"main": "./dist/entry.js",
66
"scripts": {
+32-34
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
import React from 'react';
22
import { View, Text, TextInputProps, StyleProp } from 'react-native';
33
import sb from 'react-native-style-block';
4-
import TInput, { TInputProps } from './TInput';
4+
import TInput from './TInput';
5+
import styled from 'styled-components/native';
6+
7+
const FormContainer = styled.View`
8+
flex-direction: row;
9+
align-items: center;
10+
border-bottom: 0.5px solid #ccc;
11+
margin-bottom: 10px;
12+
height: 44px;
13+
`;
14+
15+
const FormLabel = styled.Text`
16+
margin-right: 10px;
17+
flex: 1;
18+
text-align: right;
19+
font-size: 16px;
20+
min-width: 80px;
21+
height: 32px;
22+
line-height: 32px;
23+
`;
24+
25+
const FormInput = styled(TInput)`
26+
flex: 3;
27+
border: 0;
28+
background-color: transparent;
29+
font-size: 16px;
30+
`;
531

632
interface Props {
733
label: string;
834
value: string;
935
style: StyleProp<View>;
10-
input: TInputProps;
36+
input: TextInputProps;
1137
onChangeText: (text: string) => void;
1238
}
13-
1439
class TFormGroup extends React.Component<Props> {
1540
static defaultProps = {
1641
label: '',
@@ -25,43 +50,16 @@ class TFormGroup extends React.Component<Props> {
2550
this.props.input.style = [];
2651
}
2752
return (
28-
<View
29-
{...this.props}
30-
style={[...styles.container, ...(this.props.style as any)]}
31-
>
32-
<Text style={styles.label}>{this.props.label}:</Text>
33-
<TInput
53+
<FormContainer {...(this.props as any)}>
54+
<FormLabel>{this.props.label}:</FormLabel>
55+
<FormInput
3456
value={this.props.value}
3557
onChangeText={(text: string) => this.props.onChangeText(text)}
3658
{...this.props.input}
37-
style={[...styles.input, ...this.props.input.style]}
3859
/>
39-
</View>
60+
</FormContainer>
4061
);
4162
}
4263
}
4364

44-
const styles = {
45-
container: [
46-
sb.direction('row'),
47-
sb.alignCenter(),
48-
// sb.flex(),
49-
sb.border('Bottom', 0.5, '#ccc'),
50-
{ marginBottom: 10, height: 44 },
51-
],
52-
label: [
53-
sb.margin(0, 10, 0, 0),
54-
sb.flex(1),
55-
sb.textAlign('right'),
56-
sb.font(16),
57-
{ minWidth: 80, height: 32, lineHeight: 32 },
58-
],
59-
input: [
60-
sb.flex(3),
61-
sb.border('all', 0),
62-
sb.bgColor('transparent'),
63-
sb.font(16),
64-
],
65-
};
66-
6765
export default TFormGroup;

0 commit comments

Comments
 (0)