Skip to content

Commit

Permalink
Mwpw 157587 | [Geo-Routing][Page Performance] Removing the georouting…
Browse files Browse the repository at this point in the history
… modal background image (#2891)

* Update georoutingv2.css

* Update georoutingv2.js

* Delete libs/features/georoutingv2/getMobileBg.js

* Update georoutingv2.css

* Update georoutingv2.test.js

* Removing unused variable

* Delete libs/features/georoutingv2/img/GeoModal_BG_Map_Desktop.png

* Delete libs/features/georoutingv2/img/GeoModal_BG_Map_Mobile.png

* Delete libs/features/georoutingv2/img/GeoModal_BG_Map_Tablet.png
  • Loading branch information
aishwaryamathuria authored Sep 18, 2024
1 parent c2f4696 commit dbc56a7
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 54 deletions.
23 changes: 0 additions & 23 deletions libs/features/georoutingv2/georoutingv2.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
z-index: -1;
}

.dialog-modal.locale-modal-v2 .georouting-bg svg {
width: 100%;
}

.dialog-modal.locale-modal-v2 .picker {
position: fixed;
margin-top: 2px;
Expand Down Expand Up @@ -140,19 +136,6 @@
padding: initial;
}

@media (min-width: 480px) {
.dialog-modal.locale-modal-v2 {
background-image: url('/libs/features/georoutingv2/img/GeoModal_BG_Map_Tablet.png');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}

.dialog-modal.locale-modal-v2 .georouting-bg {
display: none;
}
}

@media (min-width: 600px) {
.dialog-modal.locale-modal-v2 .georouting-wrapper {
padding: 56px 56px 40px;
Expand All @@ -168,9 +151,3 @@
max-width: 720px;
}
}

@media (min-width: 1200px) {
.dialog-modal.locale-modal-v2 {
background-image: url('/libs/features/georoutingv2/img/GeoModal_BG_Map_Desktop.png');
}
}
8 changes: 1 addition & 7 deletions libs/features/georoutingv2/georoutingv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,7 @@ function buildContent(currentPage, locale, geoData, locales) {
async function getDetails(currentPage, localeMatches, geoData) {
const availableLocales = await getAvailableLocales(localeMatches);
if (!availableLocales.length) return null;
const { innerWidth } = window;
let svgDiv = null;
if (innerWidth < 480) {
const { default: getMobileBg } = await import('./getMobileBg.js');
svgDiv = createTag('div', { class: 'georouting-bg' }, getMobileBg());
}
const georoutingWrapper = createTag('div', { class: 'georouting-wrapper fragment', style: 'display:none;' }, svgDiv);
const georoutingWrapper = createTag('div', { class: 'georouting-wrapper fragment', style: 'display:none;' });
currentPage.url = window.location.hash ? document.location.href : '#';
if (availableLocales.length === 1) {
const content = buildContent(currentPage, availableLocales[0], geoData);
Expand Down
13 changes: 0 additions & 13 deletions libs/features/georoutingv2/getMobileBg.js

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 0 additions & 11 deletions test/features/georoutingv2/georoutingv2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,6 @@ describe('GeoRouting', () => {
expect(modal).to.not.be.null;
});

it('Has inline svg for mobile background', async () => {
const ogWidth = window.innerWidth;
window.innerWidth = 400;

await init(mockConfig, createTag, getMetadata, loadBlock, loadStyle);
const svg = document.querySelector('.dialog-modal .georouting-bg svg');
expect(svg).to.exist;

window.innerWidth = ogWidth;
});

it('Does not create a modal if the user IP matches session storage.', async () => {
// prepare
setUserCountryFromIP('US');
Expand Down

0 comments on commit dbc56a7

Please sign in to comment.