Skip to content

Commit

Permalink
chore: format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 14, 2021
1 parent b23cfa8 commit c2fb292
Show file tree
Hide file tree
Showing 20 changed files with 448 additions and 411 deletions.
37 changes: 20 additions & 17 deletions example/examples/src/routes/ActionSheet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { Component } from 'react';
import { StyleSheet, View, } from 'react-native';
import Layout, { Container } from '../../Layout';
import { ActionSheet, Button, ActionSheetItem, Toast } from '@uiw/react-native';
import { ComProps } from '../../routes';
import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import Layout, {Container} from '../../Layout';
import {ActionSheet, Button, ActionSheetItem, Toast} from '@uiw/react-native';
import {ComProps} from '../../routes';

const { Header, Body, Card, Footer } = Layout;
const {Header, Body, Card, Footer} = Layout;

export interface IndexProps extends ComProps { }
export interface IndexProps extends ComProps {}
export interface IndexState {
visible: boolean;
}
Expand All @@ -20,13 +20,13 @@ export default class Index extends Component<IndexProps, IndexState> {
};
}
onOpen = () => {
this.setState({ visible: true });
}
this.setState({visible: true});
};
onCancel = () => {
this.setState({ visible: false });
this.setState({visible: false});
};
render() {
const { route } = this.props;
const {route} = this.props;
const description = route.params.description;
const title = route.params.title;
return (
Expand All @@ -36,12 +36,15 @@ export default class Index extends Component<IndexProps, IndexState> {
<Body>
<View style={styles.divider} />
<Button onPress={this.onOpen}>打开 ActionSheet</Button>
<ActionSheet
visible={this.state.visible}
onCancel={true}
>
<ActionSheetItem onPress={() => Toast.info('你点击了按钮一', 2, 'info')}>按钮一</ActionSheetItem>
<ActionSheetItem onPress={() => Toast.info('你点击了按钮二', 2, 'info')}>按钮二</ActionSheetItem>
<ActionSheet visible={this.state.visible} onCancel={true}>
<ActionSheetItem
onPress={() => Toast.info('你点击了按钮一', 2, 'info')}>
按钮一
</ActionSheetItem>
<ActionSheetItem
onPress={() => Toast.info('你点击了按钮二', 2, 'info')}>
按钮二
</ActionSheetItem>
<ActionSheetItem onPress={this.onCancel}>关闭</ActionSheetItem>
</ActionSheet>
</Body>
Expand Down
22 changes: 11 additions & 11 deletions example/examples/src/routes/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { View, Text } from 'react-native';
import { Button, Spacing, Icon, Flex } from '@uiw/react-native';
import { ComProps } from '../../routes';
import Layout, { Container } from '../../Layout';
const { Header, Body, Card, Footer } = Layout;
import {View, Text} from 'react-native';
import {Button, Spacing, Icon, Flex} from '@uiw/react-native';
import {ComProps} from '../../routes';
import Layout, {Container} from '../../Layout';
const {Header, Body, Card, Footer} = Layout;

export interface ButtonViewProps extends ComProps { }
export interface ButtonViewProps extends ComProps {}

export default class ButtonView extends React.Component<ButtonViewProps> {
render() {
const { route } = this.props;
const {route} = this.props;
const description = route.params.description;
const title = route.params.title;
return (
Expand Down Expand Up @@ -108,20 +108,20 @@ export default class ButtonView extends React.Component<ButtonViewProps> {
<Button color="#f6f8fa">自定义颜色{'color="#f6f8fa"'}</Button>
</Card>
<Card title="文本样式">
<Button textStyle={{ fontSize: 20 }} color="yellow">
<Button textStyle={{fontSize: 20}} color="yellow">
字号调整{'textStyle = {{fontSize:20}}'}
</Button>
<Spacing />
<Button textStyle={{ color: 'blue' }}>
<Button textStyle={{color: 'blue'}}>
文本颜色{'textStyle={{color:"blue"}}'}
</Button>
<Spacing />
<Button color="#f6f8fa" textStyle={{ letterSpacing: 2 }}>
<Button color="#f6f8fa" textStyle={{letterSpacing: 2}}>
文本间距{'textStyle={{letterSpacing:3}}'}
</Button>
</Card>
<Card title="设置边框">
<Button bordered={false} color="#f6f8fa" >
<Button bordered={false} color="#f6f8fa">
不显示边框{'bordered={false}'}
</Button>
<Spacing />
Expand Down
2 changes: 1 addition & 1 deletion example/examples/src/routes/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const CardDemo = (props: any) => {
<Card>
{basicRender}
<Card.Actions
actions={[
actions={[
{
text: '点赞',
icon: <Icon name="like-o" size={16} color="#5847FF" />,
Expand Down
50 changes: 25 additions & 25 deletions example/examples/src/routes/CheckBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import { List, CheckBox } from '@uiw/react-native';
import { ComProps } from '../../routes';
import Layout, { Container } from '../../Layout';
const { Header, Body, Footer } = Layout;
import {List, CheckBox} from '@uiw/react-native';
import {ComProps} from '../../routes';
import Layout, {Container} from '../../Layout';
const {Header, Body, Footer} = Layout;

export interface BadgeViewProps extends ComProps { }
export interface BadgeViewProps extends ComProps {}

export default class BadgeView extends React.Component<BadgeViewProps> {
render() {
const { route } = this.props;
const {route} = this.props;
const description = route.params.description;
const title = route.params.title;
return (
Expand All @@ -17,81 +17,81 @@ export default class BadgeView extends React.Component<BadgeViewProps> {
<Header title={title} description={description} />
<Body>
<List size="large" flat={false}>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
checked={true}
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
onChange={checked => {
console.log(checked);
}}>
默认点击选中
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
onChange={checked => {
console.log(checked);
}}>
默认未选中
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
disabled
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
onChange={checked => {
console.log(checked);
}}>
默认禁用未选中
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
checked={true}
disabled
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
onChange={checked => {
console.log(checked);
}}>
默认禁用选中
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
color={'red'}
onChange={checked => {
console.log(checked);
}}>
改变选择框颜色 {'color={}'}
改变选择框颜色 {'color={}'}
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
checked={true}
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
color={'red'}
onChange={checked => {
console.log(checked);
}}>
改变选择框颜色 {'color={}'}
改变选择框颜色 {'color={}'}
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
color={'red'}
textStyle={{ fontSize: 18, color: 'red' }}
textStyle={{fontSize: 18, color: 'red'}}
onChange={checked => {
console.log(checked);
}}>
改变文字颜色和大小
</CheckBox>
</List.Item>
<List.Item style={{ paddingVertical: 0 }}>
<List.Item style={{paddingVertical: 0}}>
<CheckBox
style={{ paddingVertical: 10 }}
style={{paddingVertical: 10}}
size={20}
onChange={checked => {
console.log(checked);
Expand Down
30 changes: 15 additions & 15 deletions example/examples/src/routes/Pagination/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { Component } from 'react';
import { StyleSheet, View, } from 'react-native';
import Layout, { Container } from '../../Layout';
import { Pagination } from '@uiw/react-native';
import { ComProps } from '../../routes';
import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import Layout, {Container} from '../../Layout';
import {Pagination} from '@uiw/react-native';
import {ComProps} from '../../routes';

const { Header, Body, Card, Footer } = Layout;
const {Header, Body, Card, Footer} = Layout;

export interface IndexProps extends ComProps { }
export interface IndexProps extends ComProps {}
export interface IndexState {
current: number,
current1: number
current: number;
current1: number;
}

export default class Index extends Component<IndexProps, IndexState> {
Expand All @@ -23,35 +23,35 @@ export default class Index extends Component<IndexProps, IndexState> {
}

render() {
const { route } = this.props;
const {route} = this.props;
const description = route.params.description;
const title = route.params.title;
return (
<Container>
<Layout>
<Header title={title} description={description} />
<Body style={{ backgroundColor: '#fff' }}>
<Body style={{backgroundColor: '#fff'}}>
<Card title="使用文字">
<View style={{ paddingHorizontal: 20 }}>
<View style={{paddingHorizontal: 20}}>
<Pagination
current={this.state.current}
total={60}
pageSize={8}
onPageChange={(type, current) => {
this.setState({ current })
this.setState({current});
}}
/>
</View>
</Card>
<Card title="使用icon">
<View style={{ paddingHorizontal: 20 }}>
<View style={{paddingHorizontal: 20}}>
<Pagination
icon
current={this.state.current1}
total={50}
pageSize={20}
onPageChange={(type, current1) => {
this.setState({ current1 })
this.setState({current1});
}}
/>
</View>
Expand Down
30 changes: 15 additions & 15 deletions example/examples/src/routes/Progress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ const ProgressDemo = (props: any) => {
<Header title={title} description={description} />
<Body>
<Header description={'基本使用'} />
<Progress progressColor="#5847FF" progress={40} />
<Progress progressColor="#5847FF" progress={40} />
<Header description={'点击变化'} />
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
}}>
<Progress progress={val} progressColor="#5847FF" />
<Text style={{fontSize: 12, width: 40, textAlign: 'right'}}>
{val}%
</Text>
</View>
<Button color={'#5847FF'} onPress={onPress}>
(+-)10
</Button>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
}}>
<Progress progress={val} progressColor="#5847FF" />
<Text style={{fontSize: 12, width: 40, textAlign: 'right'}}>
{val}%
</Text>
</View>
<Button color={'#5847FF'} onPress={onPress}>
(+-)10
</Button>
</Body>
</Container>
);
Expand Down
Loading

0 comments on commit c2fb292

Please sign in to comment.