|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { TouchableOpacity, Text } from 'react-native';
|
|
|
+import { TouchableOpacity, Text, Dimensions } from 'react-native';
|
|
|
import { SvgProps } from 'react-native-svg';
|
|
|
import { Colors } from 'src/theme';
|
|
|
|
|
@@ -7,17 +7,21 @@ interface MapButtonProps {
|
|
|
onPress: () => void;
|
|
|
icon: React.ComponentType<SvgProps> | null;
|
|
|
text: string;
|
|
|
+ active?: boolean;
|
|
|
}
|
|
|
|
|
|
-const MapButton: React.FC<MapButtonProps> = ({ onPress, icon: Icon, text }) => {
|
|
|
+const MapButton: React.FC<MapButtonProps> = ({ onPress, icon: Icon, text, active = false }) => {
|
|
|
+ const isSmallScreen = Dimensions.get('window').width < 383;
|
|
|
+ const iconSize = isSmallScreen ? 14 : 16;
|
|
|
+
|
|
|
return (
|
|
|
<TouchableOpacity
|
|
|
style={{
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
- backgroundColor: Colors.WHITE,
|
|
|
+ backgroundColor: active ? Colors.ORANGE : Colors.WHITE,
|
|
|
borderRadius: 17,
|
|
|
- paddingHorizontal: 10,
|
|
|
+ paddingHorizontal: isSmallScreen ? 7 : 10,
|
|
|
paddingVertical: 6,
|
|
|
gap: 4,
|
|
|
shadowColor: '#000',
|
|
@@ -32,11 +36,11 @@ const MapButton: React.FC<MapButtonProps> = ({ onPress, icon: Icon, text }) => {
|
|
|
}}
|
|
|
onPress={onPress}
|
|
|
>
|
|
|
- {Icon && <Icon fill={Colors.DARK_BLUE} width={16} height={16} />}
|
|
|
+ {Icon && <Icon fill={active ? Colors.WHITE : Colors.DARK_BLUE} width={iconSize} height={iconSize} />}
|
|
|
<Text
|
|
|
style={{
|
|
|
- color: Colors.DARK_BLUE,
|
|
|
- fontSize: 12,
|
|
|
+ color: active ? Colors.WHITE : Colors.DARK_BLUE,
|
|
|
+ fontSize: isSmallScreen ? 11 : 12,
|
|
|
fontWeight: '600'
|
|
|
}}
|
|
|
>
|