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
65 lines
1.4 KiB
JavaScript
65 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { StyleSheet, View } from 'react-native';
|
|
|
|
const propTypes = {
|
|
children: PropTypes.node.isRequired,
|
|
style: PropTypes.object,
|
|
};
|
|
|
|
class CustomCallout extends React.Component {
|
|
render() {
|
|
return (
|
|
<View style={[styles.container, this.props.style]}>
|
|
<View style={styles.bubble}>
|
|
<View style={styles.amount}>{this.props.children}</View>
|
|
</View>
|
|
<View style={styles.arrowBorder} />
|
|
<View style={styles.arrow} />
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
CustomCallout.propTypes = propTypes;
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flexDirection: 'column',
|
|
alignSelf: 'flex-start',
|
|
},
|
|
bubble: {
|
|
width: 140,
|
|
flexDirection: 'row',
|
|
alignSelf: 'flex-start',
|
|
backgroundColor: '#4da2ab',
|
|
paddingHorizontal: 20,
|
|
paddingVertical: 12,
|
|
borderRadius: 6,
|
|
borderColor: '#007a87',
|
|
borderWidth: 0.5,
|
|
},
|
|
amount: {
|
|
flex: 1,
|
|
},
|
|
arrow: {
|
|
backgroundColor: 'transparent',
|
|
borderWidth: 16,
|
|
borderColor: 'transparent',
|
|
borderTopColor: '#4da2ab',
|
|
alignSelf: 'center',
|
|
marginTop: -32,
|
|
},
|
|
arrowBorder: {
|
|
backgroundColor: 'transparent',
|
|
borderWidth: 16,
|
|
borderColor: 'transparent',
|
|
borderTopColor: '#007a87',
|
|
alignSelf: 'center',
|
|
marginTop: -0.5,
|
|
},
|
|
});
|
|
|
|
export default CustomCallout;
|