Skip to content

Commit

Permalink
fix: 🐛 agencyInfo hover bug on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
koepferd committed Mar 5, 2021
1 parent 1bd2269 commit fc27a03
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"react-app-polyfill": "^2.0.0",
"react-datepicker": "3.3.0",
"react-dev-utils": "^11.0.0",
"react-device-detect": "^1.15.0",
"react-dom": "^17.0.1",
"react-refresh": "^0.8.3",
"react-router-dom": "5.2.0",
Expand Down
21 changes: 15 additions & 6 deletions src/components/agencySelection/AgencySelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DEFAULT_POSTCODE } from '../registration/prefillPostcode';
import { RadioButton } from '../radioButton/RadioButton';
import { Loading } from '../app/Loading';
import { Text, LABEL_TYPES } from '../text/Text';
import { isMobile } from 'react-device-detect';

const introItemsTranslations = [
'registration.agencySelection.intro.point1',
Expand Down Expand Up @@ -309,12 +310,20 @@ export const AgencySelection = (props: AgencySelectionProps) => {
agency
)
}
onMouseEnter={() =>
setDisplayAgencyInfo(agency)
}
onMouseLeave={() =>
setDisplayAgencyInfo(null)
}
onMouseEnter={() => {
if (!isMobile) {
setDisplayAgencyInfo(
agency
);
}
}}
onMouseLeave={() => {
if (!isMobile) {
setDisplayAgencyInfo(
null
);
}
}}
/>
{displayAgencyInfo &&
displayAgencyInfo?.id ===
Expand Down

0 comments on commit fc27a03

Please sign in to comment.