Skip to content

Commit

Permalink
fix(accessibility): focus map (#1390)
Browse files Browse the repository at this point in the history
* fix(accessibility): focus map

* feat(accessibility): fix style
  • Loading branch information
alebret authored Sep 12, 2022
1 parent 746c1f7 commit 767111f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
27 changes: 14 additions & 13 deletions front/src/components/aroundMe/aroundMeMap.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
SCREEN_HEIGHT,
} from "../../constants/platform.constants";
import { useAccessibilityReader } from "../../hooks";
import { Colors, Margins } from "../../styles";
import { Colors, Margins, Paddings } from "../../styles";
import {
AroundMeUtils,
KeyboardUtils,
Expand Down Expand Up @@ -274,6 +274,16 @@ const AroundMeMap: FC<ExtendedPropsForSimpleMap> = ({
/>
</View>
<View style={styles.map} onLayout={onViewMapLayout}>
<AroundMeMapHeader
headerStyle={styles.headerButtonsMapView}
displayMap
setDisplayMap={onDisplayMap}
relaunchSearch={onRelaunchSearch}
showRelaunchResearchButton={showRelaunchResearchButton}
setIsLoading={setIsLoading}
showDisplayListButton={showDisplayListButton}
hideDisplayListButton={isFromSimpleCarto}
/>
<MapView
minZoomLevel={AroundMeConstants.MAPVIEW_MIN_ZOOM_LEVEL}
ref={setMapViewRef}
Expand Down Expand Up @@ -315,16 +325,6 @@ const AroundMeMap: FC<ExtendedPropsForSimpleMap> = ({
</Marker>
)}
</MapView>
<AroundMeMapHeader
headerStyle={styles.headerButtonsMapView}
displayMap
setDisplayMap={onDisplayMap}
relaunchSearch={onRelaunchSearch}
showRelaunchResearchButton={showRelaunchResearchButton}
setIsLoading={setIsLoading}
showDisplayListButton={showDisplayListButton}
hideDisplayListButton={isFromSimpleCarto}
/>
<CustomSnackbar
isAccessibilityModeOn={isAccessibilityModeOn}
visible={showSnackBar}
Expand Down Expand Up @@ -380,18 +380,19 @@ const styles = StyleSheet.create({
headerButtonsMapView: {
backgroundColor: "transparent",
flexDirection: "row",
height: "15%",
left: 0,
margin: Margins.smaller,
padding: Paddings.smaller,
position: "absolute",
right: 0,
top: 0,
zIndex: 1,
},
mainContainer: {
flex: 1,
},
map: {
flex: 1,
marginTop: 1,
},
});

Expand Down
19 changes: 5 additions & 14 deletions front/src/components/aroundMe/aroundMeMapHeader.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const AroundMeMapHeader: FC<Props> = ({

return (
<>
<View style={headerStyle}>
<View style={[headerStyle, styles.headerBasic]}>
<CustomButton
buttonStyle={styles.headerButton}
title={Labels.articleList.filters}
Expand Down Expand Up @@ -163,6 +163,9 @@ const styles = StyleSheet.create({
buttonMarginTop: {
marginTop: Margins.smaller,
},
headerBasic: {
flexWrap: "wrap",
},
headerButton: {
backgroundColor: Colors.white,
borderColor: Colors.primaryBlue,
Expand All @@ -177,19 +180,7 @@ const styles = StyleSheet.create({
headerButtonsRightPartView: {
alignItems: "flex-end",
backgroundColor: "transparent",
justifyContent: "flex-end",
position: "absolute",
right: 0,
},
headerButtonsView: {
backgroundColor: "transparent",
flexDirection: "row",
height: "15%",
left: 0,
margin: Margins.smaller,
position: "absolute",
right: 0,
top: 0,
flexGrow: 1,
},
});

Expand Down

0 comments on commit 767111f

Please sign in to comment.