Skip to content

Commit c2fb292

Browse files
committed
chore: format code.
1 parent b23cfa8 commit c2fb292

File tree

20 files changed

+448
-411
lines changed

20 files changed

+448
-411
lines changed

example/examples/src/routes/ActionSheet/index.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React, { Component } from 'react';
2-
import { StyleSheet, View, } from 'react-native';
3-
import Layout, { Container } from '../../Layout';
4-
import { ActionSheet, Button, ActionSheetItem, Toast } from '@uiw/react-native';
5-
import { ComProps } from '../../routes';
1+
import React, {Component} from 'react';
2+
import {StyleSheet, View} from 'react-native';
3+
import Layout, {Container} from '../../Layout';
4+
import {ActionSheet, Button, ActionSheetItem, Toast} from '@uiw/react-native';
5+
import {ComProps} from '../../routes';
66

7-
const { Header, Body, Card, Footer } = Layout;
7+
const {Header, Body, Card, Footer} = Layout;
88

9-
export interface IndexProps extends ComProps { }
9+
export interface IndexProps extends ComProps {}
1010
export interface IndexState {
1111
visible: boolean;
1212
}
@@ -20,13 +20,13 @@ export default class Index extends Component<IndexProps, IndexState> {
2020
};
2121
}
2222
onOpen = () => {
23-
this.setState({ visible: true });
24-
}
23+
this.setState({visible: true});
24+
};
2525
onCancel = () => {
26-
this.setState({ visible: false });
26+
this.setState({visible: false});
2727
};
2828
render() {
29-
const { route } = this.props;
29+
const {route} = this.props;
3030
const description = route.params.description;
3131
const title = route.params.title;
3232
return (
@@ -36,12 +36,15 @@ export default class Index extends Component<IndexProps, IndexState> {
3636
<Body>
3737
<View style={styles.divider} />
3838
<Button onPress={this.onOpen}>打开 ActionSheet</Button>
39-
<ActionSheet
40-
visible={this.state.visible}
41-
onCancel={true}
42-
>
43-
<ActionSheetItem onPress={() => Toast.info('你点击了按钮一', 2, 'info')}>按钮一</ActionSheetItem>
44-
<ActionSheetItem onPress={() => Toast.info('你点击了按钮二', 2, 'info')}>按钮二</ActionSheetItem>
39+
<ActionSheet visible={this.state.visible} onCancel={true}>
40+
<ActionSheetItem
41+
onPress={() => Toast.info('你点击了按钮一', 2, 'info')}>
42+
按钮一
43+
</ActionSheetItem>
44+
<ActionSheetItem
45+
onPress={() => Toast.info('你点击了按钮二', 2, 'info')}>
46+
按钮二
47+
</ActionSheetItem>
4548
<ActionSheetItem onPress={this.onCancel}>关闭</ActionSheetItem>
4649
</ActionSheet>
4750
</Body>

example/examples/src/routes/Button/index.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from 'react';
2-
import { View, Text } from 'react-native';
3-
import { Button, Spacing, Icon, Flex } from '@uiw/react-native';
4-
import { ComProps } from '../../routes';
5-
import Layout, { Container } from '../../Layout';
6-
const { Header, Body, Card, Footer } = Layout;
2+
import {View, Text} from 'react-native';
3+
import {Button, Spacing, Icon, Flex} from '@uiw/react-native';
4+
import {ComProps} from '../../routes';
5+
import Layout, {Container} from '../../Layout';
6+
const {Header, Body, Card, Footer} = Layout;
77

8-
export interface ButtonViewProps extends ComProps { }
8+
export interface ButtonViewProps extends ComProps {}
99

1010
export default class ButtonView extends React.Component<ButtonViewProps> {
1111
render() {
12-
const { route } = this.props;
12+
const {route} = this.props;
1313
const description = route.params.description;
1414
const title = route.params.title;
1515
return (
@@ -108,20 +108,20 @@ export default class ButtonView extends React.Component<ButtonViewProps> {
108108
<Button color="#f6f8fa">自定义颜色{'color="#f6f8fa"'}</Button>
109109
</Card>
110110
<Card title="文本样式">
111-
<Button textStyle={{ fontSize: 20 }} color="yellow">
111+
<Button textStyle={{fontSize: 20}} color="yellow">
112112
字号调整{'textStyle = {{fontSize:20}}'}
113113
</Button>
114114
<Spacing />
115-
<Button textStyle={{ color: 'blue' }}>
115+
<Button textStyle={{color: 'blue'}}>
116116
文本颜色{'textStyle={{color:"blue"}}'}
117117
</Button>
118118
<Spacing />
119-
<Button color="#f6f8fa" textStyle={{ letterSpacing: 2 }}>
119+
<Button color="#f6f8fa" textStyle={{letterSpacing: 2}}>
120120
文本间距{'textStyle={{letterSpacing:3}}'}
121121
</Button>
122122
</Card>
123123
<Card title="设置边框">
124-
<Button bordered={false} color="#f6f8fa" >
124+
<Button bordered={false} color="#f6f8fa">
125125
不显示边框{'bordered={false}'}
126126
</Button>
127127
<Spacing />

example/examples/src/routes/Card/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const CardDemo = (props: any) => {
5858
<Card>
5959
{basicRender}
6060
<Card.Actions
61-
actions={[
61+
actions={[
6262
{
6363
text: '点赞',
6464
icon: <Icon name="like-o" size={16} color="#5847FF" />,

example/examples/src/routes/CheckBox/index.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react';
2-
import { List, CheckBox } from '@uiw/react-native';
3-
import { ComProps } from '../../routes';
4-
import Layout, { Container } from '../../Layout';
5-
const { Header, Body, Footer } = Layout;
2+
import {List, CheckBox} from '@uiw/react-native';
3+
import {ComProps} from '../../routes';
4+
import Layout, {Container} from '../../Layout';
5+
const {Header, Body, Footer} = Layout;
66

7-
export interface BadgeViewProps extends ComProps { }
7+
export interface BadgeViewProps extends ComProps {}
88

99
export default class BadgeView extends React.Component<BadgeViewProps> {
1010
render() {
11-
const { route } = this.props;
11+
const {route} = this.props;
1212
const description = route.params.description;
1313
const title = route.params.title;
1414
return (
@@ -17,81 +17,81 @@ export default class BadgeView extends React.Component<BadgeViewProps> {
1717
<Header title={title} description={description} />
1818
<Body>
1919
<List size="large" flat={false}>
20-
<List.Item style={{ paddingVertical: 0 }}>
20+
<List.Item style={{paddingVertical: 0}}>
2121
<CheckBox
2222
checked={true}
23-
style={{ paddingVertical: 10 }}
23+
style={{paddingVertical: 10}}
2424
onChange={checked => {
2525
console.log(checked);
2626
}}>
2727
默认点击选中
2828
</CheckBox>
2929
</List.Item>
30-
<List.Item style={{ paddingVertical: 0 }}>
30+
<List.Item style={{paddingVertical: 0}}>
3131
<CheckBox
32-
style={{ paddingVertical: 10 }}
32+
style={{paddingVertical: 10}}
3333
onChange={checked => {
3434
console.log(checked);
3535
}}>
3636
默认未选中
3737
</CheckBox>
3838
</List.Item>
39-
<List.Item style={{ paddingVertical: 0 }}>
39+
<List.Item style={{paddingVertical: 0}}>
4040
<CheckBox
4141
disabled
42-
style={{ paddingVertical: 10 }}
42+
style={{paddingVertical: 10}}
4343
onChange={checked => {
4444
console.log(checked);
4545
}}>
4646
默认禁用未选中
4747
</CheckBox>
4848
</List.Item>
49-
<List.Item style={{ paddingVertical: 0 }}>
49+
<List.Item style={{paddingVertical: 0}}>
5050
<CheckBox
5151
checked={true}
5252
disabled
53-
style={{ paddingVertical: 10 }}
53+
style={{paddingVertical: 10}}
5454
onChange={checked => {
5555
console.log(checked);
5656
}}>
5757
默认禁用选中
5858
</CheckBox>
5959
</List.Item>
60-
<List.Item style={{ paddingVertical: 0 }}>
60+
<List.Item style={{paddingVertical: 0}}>
6161
<CheckBox
62-
style={{ paddingVertical: 10 }}
62+
style={{paddingVertical: 10}}
6363
color={'red'}
6464
onChange={checked => {
6565
console.log(checked);
6666
}}>
67-
改变选择框颜色 {'color={}'}
67+
改变选择框颜色 {'color={}'}
6868
</CheckBox>
6969
</List.Item>
70-
<List.Item style={{ paddingVertical: 0 }}>
70+
<List.Item style={{paddingVertical: 0}}>
7171
<CheckBox
7272
checked={true}
73-
style={{ paddingVertical: 10 }}
73+
style={{paddingVertical: 10}}
7474
color={'red'}
7575
onChange={checked => {
7676
console.log(checked);
7777
}}>
78-
改变选择框颜色 {'color={}'}
78+
改变选择框颜色 {'color={}'}
7979
</CheckBox>
8080
</List.Item>
81-
<List.Item style={{ paddingVertical: 0 }}>
81+
<List.Item style={{paddingVertical: 0}}>
8282
<CheckBox
83-
style={{ paddingVertical: 10 }}
83+
style={{paddingVertical: 10}}
8484
color={'red'}
85-
textStyle={{ fontSize: 18, color: 'red' }}
85+
textStyle={{fontSize: 18, color: 'red'}}
8686
onChange={checked => {
8787
console.log(checked);
8888
}}>
8989
改变文字颜色和大小
9090
</CheckBox>
9191
</List.Item>
92-
<List.Item style={{ paddingVertical: 0 }}>
92+
<List.Item style={{paddingVertical: 0}}>
9393
<CheckBox
94-
style={{ paddingVertical: 10 }}
94+
style={{paddingVertical: 10}}
9595
size={20}
9696
onChange={checked => {
9797
console.log(checked);

example/examples/src/routes/Pagination/index.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React, { Component } from 'react';
2-
import { StyleSheet, View, } from 'react-native';
3-
import Layout, { Container } from '../../Layout';
4-
import { Pagination } from '@uiw/react-native';
5-
import { ComProps } from '../../routes';
1+
import React, {Component} from 'react';
2+
import {StyleSheet, View} from 'react-native';
3+
import Layout, {Container} from '../../Layout';
4+
import {Pagination} from '@uiw/react-native';
5+
import {ComProps} from '../../routes';
66

7-
const { Header, Body, Card, Footer } = Layout;
7+
const {Header, Body, Card, Footer} = Layout;
88

9-
export interface IndexProps extends ComProps { }
9+
export interface IndexProps extends ComProps {}
1010
export interface IndexState {
11-
current: number,
12-
current1: number
11+
current: number;
12+
current1: number;
1313
}
1414

1515
export default class Index extends Component<IndexProps, IndexState> {
@@ -23,35 +23,35 @@ export default class Index extends Component<IndexProps, IndexState> {
2323
}
2424

2525
render() {
26-
const { route } = this.props;
26+
const {route} = this.props;
2727
const description = route.params.description;
2828
const title = route.params.title;
2929
return (
3030
<Container>
3131
<Layout>
3232
<Header title={title} description={description} />
33-
<Body style={{ backgroundColor: '#fff' }}>
33+
<Body style={{backgroundColor: '#fff'}}>
3434
<Card title="使用文字">
35-
<View style={{ paddingHorizontal: 20 }}>
35+
<View style={{paddingHorizontal: 20}}>
3636
<Pagination
3737
current={this.state.current}
3838
total={60}
3939
pageSize={8}
4040
onPageChange={(type, current) => {
41-
this.setState({ current })
41+
this.setState({current});
4242
}}
4343
/>
4444
</View>
4545
</Card>
4646
<Card title="使用icon">
47-
<View style={{ paddingHorizontal: 20 }}>
47+
<View style={{paddingHorizontal: 20}}>
4848
<Pagination
4949
icon
5050
current={this.state.current1}
5151
total={50}
5252
pageSize={20}
5353
onPageChange={(type, current1) => {
54-
this.setState({ current1 })
54+
this.setState({current1});
5555
}}
5656
/>
5757
</View>

example/examples/src/routes/Progress/index.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ const ProgressDemo = (props: any) => {
2525
<Header title={title} description={description} />
2626
<Body>
2727
<Header description={'基本使用'} />
28-
<Progress progressColor="#5847FF" progress={40} />
28+
<Progress progressColor="#5847FF" progress={40} />
2929
<Header description={'点击变化'} />
30-
<View
31-
style={{
32-
flexDirection: 'row',
33-
justifyContent: 'space-between',
34-
alignItems: 'center',
35-
}}>
36-
<Progress progress={val} progressColor="#5847FF" />
37-
<Text style={{fontSize: 12, width: 40, textAlign: 'right'}}>
38-
{val}%
39-
</Text>
40-
</View>
41-
<Button color={'#5847FF'} onPress={onPress}>
42-
(+-)10
43-
</Button>
30+
<View
31+
style={{
32+
flexDirection: 'row',
33+
justifyContent: 'space-between',
34+
alignItems: 'center',
35+
}}>
36+
<Progress progress={val} progressColor="#5847FF" />
37+
<Text style={{fontSize: 12, width: 40, textAlign: 'right'}}>
38+
{val}%
39+
</Text>
40+
</View>
41+
<Button color={'#5847FF'} onPress={onPress}>
42+
(+-)10
43+
</Button>
4444
</Body>
4545
</Container>
4646
);

0 commit comments

Comments
 (0)