mirror of
https://github.com/expo/react-native-maps.git
synced 2026-11-15 09:18:08 -10:00
* move eslitnt rules to @react-native-community/eslint-config * gitignore VSCode workspace settings * update eslint related packages and remove airbnb ones * add .prettierrc config * automated fix by eslint and prettier * remove custom eslint rules * remove never reported elint exceptions * remove unlimited eslint-disable exceptions * fix formating * fix inline styles * fix react to 16.8.3 and remove babel-preset-react-native
76 lines
1.6 KiB
JavaScript
76 lines
1.6 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { StyleSheet, View, Text } from 'react-native';
|
|
|
|
const propTypes = {
|
|
amount: PropTypes.number.isRequired,
|
|
fontSize: PropTypes.number,
|
|
};
|
|
|
|
const defaultProps = {
|
|
fontSize: 13,
|
|
};
|
|
|
|
class PriceMarker extends React.Component {
|
|
render() {
|
|
const { fontSize, amount } = this.props;
|
|
return (
|
|
<View style={styles.container}>
|
|
<View style={styles.bubble}>
|
|
<Text style={styles.dollar}>$</Text>
|
|
<Text style={[styles.amount, { fontSize }]}>{amount}</Text>
|
|
</View>
|
|
<View style={styles.arrowBorder} />
|
|
<View style={styles.arrow} />
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
PriceMarker.propTypes = propTypes;
|
|
PriceMarker.defaultProps = defaultProps;
|
|
|
|
const 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,
|
|
},
|
|
});
|
|
|
|
export default PriceMarker;
|