mirror of
https://github.com/expo/react-native-maps.git
synced 2026-11-15 09:18:08 -10:00
71 lines
1.4 KiB
JavaScript
71 lines
1.4 KiB
JavaScript
let React = require('react');
|
|
const ReactNative = require('react-native');
|
|
let {
|
|
StyleSheet,
|
|
View,
|
|
Text,
|
|
} = ReactNative;
|
|
|
|
const PriceMarker = React.createClass({
|
|
getDefaultProps() {
|
|
return {
|
|
fontSize: 13,
|
|
};
|
|
},
|
|
render() {
|
|
return (
|
|
<View style={styles.container}>
|
|
<View style={styles.bubble}>
|
|
<Text style={styles.dollar}>$</Text>
|
|
<Text style={[styles.amount, { fontSize: this.props.fontSize }]}>{this.props.amount}</Text>
|
|
</View>
|
|
<View style={styles.arrowBorder} />
|
|
<View style={styles.arrow} />
|
|
</View>
|
|
);
|
|
},
|
|
});
|
|
|
|
let styles = StyleSheet.create({
|
|
container: {
|
|
flexDirection: 'column',
|
|
alignSelf: 'flex-start',
|
|
},
|
|
bubble: {
|
|
flex: 0,
|
|
flexDirection: 'row',
|
|
alignSelf: 'flex-start',
|
|
backgroundColor: '#FF5A5F',
|
|
padding: 2,
|
|
borderRadius: 3,
|
|
borderColor: '#D23F44',
|
|
borderWidth: 0.5,
|
|
},
|
|
dollar: {
|
|
color: '#FFFFFF',
|
|
fontSize: 10,
|
|
},
|
|
amount: {
|
|
color: '#FFFFFF',
|
|
fontSize: 13,
|
|
},
|
|
arrow: {
|
|
backgroundColor: 'transparent',
|
|
borderWidth: 4,
|
|
borderColor: 'transparent',
|
|
borderTopColor: '#FF5A5F',
|
|
alignSelf: 'center',
|
|
marginTop: -9,
|
|
},
|
|
arrowBorder: {
|
|
backgroundColor: 'transparent',
|
|
borderWidth: 4,
|
|
borderColor: 'transparent',
|
|
borderTopColor: '#D23F44',
|
|
alignSelf: 'center',
|
|
marginTop: -0.5,
|
|
},
|
|
});
|
|
|
|
module.exports = PriceMarker;
|