Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand the range of clicks #135

Merged
merged 6 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
403 changes: 125 additions & 278 deletions package-lock.json

Large diffs are not rendered by default.

1,069 changes: 541 additions & 528 deletions src/components/Active.js

Large diffs are not rendered by default.

143 changes: 72 additions & 71 deletions src/components/CoinRow.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,72 @@
/*
* @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED
* This file is part of Polkawallet.

It under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
You should have received a copy of the GNU General Public License
along with Polkawallet. If not, see <http://www.gnu.org/licenses/>.

* @Autor: POLKAWALLET LIMITED
* @Date: 2019-06-18 21:08:00
*/
import React, { Component } from 'react'
import { Image, View, TouchableOpacity, Text } from 'react-native'
import moment from 'moment/moment'
import { formatBalance } from '@polkadot/util'
import { ScreenWidth } from '../util/Common'

export default class CoinRow extends Component {
render() {
const { item, index, navigation } = this.props
return (
<TouchableOpacity
key={index}
onPress={() => {
navigation.navigate('Transfer_details', { data: item })
}}
style={{
alignItems: 'center',
flexDirection: 'row',
height: 64,
borderBottomWidth: 1,
borderColor: '#F0F0F0'
}}
>
<View style={{ marginLeft: ScreenWidth / 16.3, flex: 1 }}>
<Text
ellipsizeMode="middle"
numberOfLines={1}
style={{ fontSize: 14, color: '#3E2D32', width: ScreenWidth * 0.4 }}
>
{item.tx_address}
</Text>
<Text style={{ marginTop: 5, fontSize: 13, color: '#AAAAAA' }}>
{moment(item.tx_timestamp).format('DD/MM/YYYY HH:mm:ss')}
</Text>
</View>
{/* 余额 | Balance */}
<Text
style={{
marginRight: ScreenWidth / 20,
fontSize: 16,
color: '#3E2D32'
}}
>
{item.tx_type == 'Receive'
? `+ ${formatBalance(String(item.tx_value))}`
: `- ${formatBalance(String(item.tx_value))}`}
</Text>
<Image
source={
item.tx_type == 'Receive'
? require('../assets/images/public/assets_btc_down.png')
: require('../assets/images/public/assets_btc_up.png')
}
style={{ width: 7, height: 12, marginRight: 24 }}
/>
</TouchableOpacity>
)
}
}
/*
* @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED
* This file is part of Polkawallet.

It under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
You should have received a copy of the GNU General Public License
along with Polkawallet. If not, see <http://www.gnu.org/licenses/>.

* @Autor: POLKAWALLET LIMITED
* @Date: 2019-06-18 21:08:00
*/
import React, { Component } from 'react'
import { Image, View, TouchableOpacity, Text } from 'react-native'
import moment from 'moment/moment'
import { formatBalance } from '@polkadot/util'
import { ScreenWidth } from '../util/Common'

export default class CoinRow extends Component {
render() {
const { item, index, navigation } = this.props
return (
<TouchableOpacity
key={index}
activeOpacity={0.7}
onPress={() => {
navigation.navigate('Transfer_details', { data: item })
}}
style={{
alignItems: 'center',
flexDirection: 'row',
height: 64,
borderBottomWidth: 1,
borderColor: '#F0F0F0'
}}
>
<View style={{ marginLeft: ScreenWidth / 16.3, flex: 1 }}>
<Text
ellipsizeMode="middle"
numberOfLines={1}
style={{ fontSize: 14, color: '#3E2D32', width: ScreenWidth * 0.4 }}
>
{item.tx_address}
</Text>
<Text style={{ marginTop: 5, fontSize: 13, color: '#AAAAAA' }}>
{moment(item.tx_timestamp).format('DD/MM/YYYY HH:mm:ss')}
</Text>
</View>
{/* 余额 | Balance */}
<Text
style={{
marginRight: ScreenWidth / 20,
fontSize: 16,
color: '#3E2D32'
}}
>
{item.tx_type == 'Receive'
? `+ ${formatBalance(String(item.tx_value))}`
: `- ${formatBalance(String(item.tx_value))}`}
</Text>
<Image
source={
item.tx_type == 'Receive'
? require('../assets/images/public/assets_btc_down.png')
: require('../assets/images/public/assets_btc_up.png')
}
style={{ width: 7, height: 12, marginRight: 24 }}
/>
</TouchableOpacity>
)
}
}
165 changes: 87 additions & 78 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,78 +1,87 @@
/*
* @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED
* This file is part of Polkawallet.

It under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
You should have received a copy of the GNU General Public License
along with Polkawallet. If not, see <http://www.gnu.org/licenses/>.

* @Autor: POLKAWALLET LIMITED
* @Date: 2019-06-18 21:08:00
*/
import React, { Component } from 'react'
import { Image, View, TouchableOpacity, Text } from 'react-native'
import { ScreenWidth } from '../util/Common'

export default class Header extends Component {
back() {
this.props.navigation.goBack()
}

render() {
const { title, rightIcon, rightPress, backPress } = this.props
const theme = this.props.theme || 'light'
return (
<View
style={{
width: ScreenWidth,
paddingRight: 20,
height: 44,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
}}
>
<TouchableOpacity
activeOpacity={0.7}
onPress={backPress ? backPress() : this.back.bind(this)}
style={{ paddingLeft: 20, height: 44, width: 61 }}
>
{/* <View> */}
<Image
source={
theme == 'light'
? require('../assets/images/Assets/sweep_code_return.png')
: theme == 'dark' && require('../assets/images/public/About_return.png')
}
style={{ width: theme == 'light' ? 11 : 16, marginTop: 15, height: 16 }}
/>
{/* </View> */}
</TouchableOpacity>
<Text
style={{
color: theme == 'light' ? '#FFF' : theme == 'dark' && '#3E2D32',
fontSize: 18,
marginLeft: -25,
fontWeight: '700'
}}
>
{title}
</Text>
{rightIcon ? (
<TouchableOpacity
onPress={() => {
rightPress()
}}
>
<Image source={rightIcon} style={{ width: 20, height: 20 }} />
</TouchableOpacity>
) : (
<TouchableOpacity>
<Image style={{ width: 20, height: 20 }} />
</TouchableOpacity>
)}
</View>
)
}
}
/*
* @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED
* This file is part of Polkawallet.

It under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
You should have received a copy of the GNU General Public License
along with Polkawallet. If not, see <http://www.gnu.org/licenses/>.

* @Autor: POLKAWALLET LIMITED
* @Date: 2019-06-18 21:08:00
*/
import React, { Component } from 'react'
import { Image, View, TouchableOpacity, Text } from 'react-native'
import { ScreenWidth } from '../util/Common'

export default class Header extends Component {
/**
* @description 返回上一页 | Go back to the previous page.
*/
back() {
this.props.navigation.goBack()
}

render() {
const { title, rightIcon, rightPress, backPress } = this.props
const theme = this.props.theme || 'light'
return (
<View
style={{
width: ScreenWidth,
paddingRight: 20,
height: 44,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
}}
>
<TouchableOpacity
activeOpacity={0.7}
onPress={backPress ? backPress() : this.back.bind(this)}
style={{ paddingLeft: 20, height: 44, width: 61 }}
>
{/* <View> */}
<Image
source={
theme == 'light'
? require('../assets/images/Assets/sweep_code_return.png')
: theme == 'dark' && require('../assets/images/public/About_return.png')
}
style={{
width: theme == 'light' ? 11 : 16,
marginTop: 15,
height: 16
}}
/>
{/* </View> */}
</TouchableOpacity>
<Text
style={{
color: theme == 'light' ? '#FFF' : theme == 'dark' && '#3E2D32',
fontSize: 18,
marginLeft: -25,
fontWeight: '700'
}}
>
{title}
</Text>
{rightIcon ? (
<TouchableOpacity
style={{ padding: 10 }}
onPress={() => {
rightPress()
}}
activeOpacity={0.7}
>
<Image source={rightIcon} style={{ width: 20, height: 20 }} />
</TouchableOpacity>
) : (
<TouchableOpacity style={{ padding: 10 }} activeOpacity={0.7}>
<Image style={{ width: 20, height: 20 }} />
</TouchableOpacity>
)}
</View>
)
}
}
Loading