-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from CaronaBoard/ui-tweaks
Ui tweaks
- Loading branch information
Showing
6 changed files
with
158 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import PropTypes from 'prop-types' | ||
import React, { Component } from 'react' | ||
import { RkCard } from 'react-native-ui-kitten' | ||
import Icon from 'react-native-vector-icons/MaterialIcons' | ||
import { View, Text, TouchableOpacity } from 'react-native' | ||
|
||
import { RidePropType } from '../types' | ||
import Styles from './styles/YourRideRequest.style' | ||
import { LoadingSpinnerView } from '../../shared/components/LoadingSpinnerView' | ||
|
||
export class YourRideRequest extends Component { | ||
static propTypes = { | ||
ride: RidePropType.isRequired, | ||
onPress: PropTypes.func.isRequired, | ||
icon: PropTypes.node | ||
} | ||
|
||
state = { | ||
loading: false | ||
} | ||
|
||
onPress = async (ride) => { | ||
this.setState({loading: true}) | ||
await this.props.onPress(ride) | ||
this.setState({loading: false}) | ||
} | ||
|
||
render () { | ||
const { ride } = this.props | ||
const { | ||
origin, | ||
destination, | ||
days, | ||
hours, | ||
profile | ||
} = ride | ||
|
||
return ( | ||
<LoadingSpinnerView isLoading={this.state.loading} > | ||
<TouchableOpacity onPress={() => this.onPress({ ride })}> | ||
<RkCard> | ||
<View rkCardContent> | ||
<View style={Styles.line} > | ||
<Text rkCardText>{`Você pediu carona para ${profile.name}`}</Text> | ||
</View> | ||
<View style={Styles.line} > | ||
<Text rkCardText>{`De: ${origin}`}</Text> | ||
</View> | ||
<View style={Styles.line} > | ||
<Text rkCardText>{`Para: ${destination}`}</Text> | ||
</View> | ||
<View style={Styles.line} > | ||
<Text rkCardText>{`Em: ${days}`}</Text> | ||
</View> | ||
<View style={Styles.line} > | ||
<Text rkCardText>{`As: ${hours}`}</Text> | ||
</View> | ||
</View> | ||
<Icon | ||
name='delete-forever' | ||
size={30} | ||
color='#900' | ||
style={Styles.icon} | ||
/> | ||
</RkCard> | ||
</TouchableOpacity> | ||
</LoadingSpinnerView> | ||
) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/modules/rideRequest/components/styles/YourRideRequest.style.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { StyleSheet } from 'react-native' | ||
import { Fonts, Metrics } from '../../../shared/themes/index' | ||
|
||
export default StyleSheet.create({ | ||
container: { | ||
flexDirection: 'column', | ||
alignItems: 'flex-start', | ||
margin: Metrics.baseMargin | ||
}, | ||
title: { | ||
...Fonts.style.h4 | ||
}, | ||
subTitle: { | ||
...Fonts.style.h6 | ||
}, | ||
text: { | ||
...Fonts.style.input | ||
}, | ||
line: { | ||
flexDirection: 'row', | ||
alignItems: 'center' | ||
}, | ||
icon: { | ||
marginRight: Metrics.smallMargin, | ||
alignSelf: 'flex-end' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters