UNPKG

1.79 kBJavaScriptView Raw
1import React from "react";
2import { View, StyleSheet, Platform, TouchableHighlight } from "react-native";
3
4class DefaultMarker extends React.Component {
5 render() {
6 return (
7 <TouchableHighlight>
8 <View
9 style={
10 this.props.enabled
11 ? [
12 styles.markerStyle,
13 this.props.markerStyle,
14 this.props.pressed && styles.pressedMarkerStyle,
15 this.props.pressed && this.props.pressedMarkerStyle
16 ]
17 : [styles.markerStyle, styles.disabled]
18 }
19 />
20 </TouchableHighlight>
21 );
22 }
23}
24
25const styles = StyleSheet.create({
26 markerStyle: {
27 ...Platform.select({
28 ios: {
29 height: 30,
30 width: 30,
31 borderRadius: 30,
32 borderWidth: 1,
33 borderColor: "#DDDDDD",
34 backgroundColor: "#FFFFFF",
35 shadowColor: "#000000",
36 shadowOffset: {
37 width: 0,
38 height: 3
39 },
40 shadowRadius: 1,
41 shadowOpacity: 0.2
42 },
43 android: {
44 height: 12,
45 width: 12,
46 borderRadius: 12,
47 backgroundColor: "#0D8675"
48 },
49 web: {
50 height: 30,
51 width: 30,
52 borderRadius: 30,
53 borderWidth: 1,
54 borderColor: "#DDDDDD",
55 backgroundColor: "#FFFFFF",
56 shadowColor: "#000000",
57 shadowOffset: {
58 width: 0,
59 height: 3
60 },
61 shadowRadius: 1,
62 shadowOpacity: 0.2
63 }
64 })
65 },
66 pressedMarkerStyle: {
67 ...Platform.select({
68 web: {},
69 ios: {},
70 android: {
71 height: 20,
72 width: 20,
73 borderRadius: 20
74 }
75 })
76 },
77 disabled: {
78 backgroundColor: "#d3d3d3"
79 }
80});
81
82export default DefaultMarker;