Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: able to use map area between buttons #4921

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 39 additions & 31 deletions src/components/map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,40 +305,48 @@ export const Map = (props: MapProps) => {
/>
)}
</MapboxGL.MapView>
<View style={controlStyles.controlsContainer}>
<View>
{isBonusProgramEnabled &&
props.selectionMode === 'ExploreEntities' && (
<BonusProgramMapButton
onPress={() => onMapClick({source: 'bonus-program-button'})}
/>
)}
</View>

<View>
<ExternalRealtimeMapButton onMapClick={onMapClick} />

{(props.vehicles || props.stations) && (
<MapFilter
onPress={() => onMapClick({source: 'filters-button'})}
isLoading={
(props.vehicles?.isLoading || props.stations?.isLoading) ??
false
}
<View
style={[
controlStyles.mapButtonsContainer,
controlStyles['mapButtonsContainer--left'],
]}
>
{isBonusProgramEnabled &&
props.selectionMode === 'ExploreEntities' && (
<BonusProgramMapButton
onPress={() => onMapClick({source: 'bonus-program-button'})}
/>
)}
<PositionArrow
onPress={async () => {
const coordinates = await getCurrentCoordinates(true);
if (coordinates) {
onMapClick({
source: 'my-position',
coords: coordinates,
});
}
}}
</View>

<View
style={[
controlStyles.mapButtonsContainer,
controlStyles['mapButtonsContainer--right'],
]}
>
<ExternalRealtimeMapButton onMapClick={onMapClick} />

{(props.vehicles || props.stations) && (
<MapFilter
onPress={() => onMapClick({source: 'filters-button'})}
isLoading={
(props.vehicles?.isLoading || props.stations?.isLoading) ??
false
}
/>
</View>
)}
<PositionArrow
onPress={async () => {
const coordinates = await getCurrentCoordinates(true);
if (coordinates) {
onMapClick({
source: 'my-position',
coords: coordinates,
});
}
}}
/>
</View>
{isShmoDeepIntegrationEnabled && (
<ShmoTesting selectedVehicleId={selectedFeature?.properties?.id} />
Expand Down
16 changes: 10 additions & 6 deletions src/components/map/hooks/use-control-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ export function useControlPositionsStyle(extraPaddingBottom = false) {
top: top + theme.spacing.medium,
right: theme.spacing.medium,
},
controlsContainer: {

mapButtonsContainer: {
position: 'absolute',
width: '100%',
bottom:
(extraPaddingBottom ? bottom : 0) +
bottomPaddingIfBottomSheetIsOpen +
theme.spacing.medium,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'flex-end',
paddingHorizontal: theme.spacing.medium,
},

'mapButtonsContainer--left': {
left: theme.spacing.medium,
},

'mapButtonsContainer--right': {
right: theme.spacing.medium,
},
jorunnl marked this conversation as resolved.
Show resolved Hide resolved
locationContainer: {
position: 'absolute',
Expand Down
Loading