Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit a761945

Browse files
authored
Merge pull request #354 from openforge/safari-webp-fix
fix(app-case-study.tsx): remove force of webp for assets
2 parents 07e968f + f1a34a7 commit a761945

File tree

4 files changed

+15
-36
lines changed

4 files changed

+15
-36
lines changed

src/pages/app-case-study/app-case-study.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { Component, Prop } from '@stencil/core';
1+
import { Component } from '@stencil/core';
22

33
@Component({
44
tag: 'app-case-study',
55
styleUrl: 'app-case-study.scss',
66
})
77
export class AppCaseStudy {
8-
@Prop({ context: 'isServer' })
9-
private isServer: boolean;
10-
11-
private className;
12-
componentWillLoad() {
13-
this.className = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
14-
}
8+
// private className = localStorage.getItem('allowWebp') === 'true' ? 'webp' : 'hero';
159

1610
scrollToTop() {
1711
const form = document.getElementsByTagName('header')[0];
@@ -34,7 +28,7 @@ export class AppCaseStudy {
3428
render() {
3529
return (
3630
<div class="case-study">
37-
<header class={this.className}>
31+
<header class="hero">
3832
<div class="container">
3933
<div class="row align-items-center">
4034
<div style={{ margin: 'auto' }}>

src/pages/app-resources/app-resources.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { MatchResults, RouterHistory } from '@stencil/router';
77
styleUrl: 'app-resources.scss',
88
})
99
export class AppResources {
10+
// private className = localStorage.getItem('allowWebp') === 'true' ? 'webp' : 'hero';
11+
1012
@State() formSubmitted = false;
1113
@State() formSubmitting = false;
1214

@@ -38,10 +40,6 @@ export class AppResources {
3840
};
3941
@Prop() match: MatchResults;
4042
@Prop() history: RouterHistory;
41-
@Prop({ context: 'isServer' })
42-
private isServer: boolean;
43-
44-
private className;
4543

4644
@Listen('check')
4745
@Listen('valueChange')
@@ -54,8 +52,6 @@ export class AppResources {
5452
}
5553

5654
componentWillLoad() {
57-
this.className = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
58-
5955
if (this.match.params.source !== 'pwa-white-paper') {
6056
this.history.push(`/`, {});
6157
}
@@ -145,7 +141,7 @@ export class AppResources {
145141
<div id="top" class="resources">
146142
{/* header - hero */}
147143
{!this.formSubmitted ? (
148-
<header class={this.className}>
144+
<header class="hero">
149145
<div class="overlay">
150146
<div class="container">
151147
<div class="row align-items-center">

src/pages/app-team-landing/app-team-landing.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Prop, State, Watch } from '@stencil/core';
1+
import { Component, State, Prop, Watch } from '@stencil/core';
22
import { MatchResults, RouterHistory } from '@stencil/router';
33
import { translate } from '../../services/translation.service';
44

@@ -7,10 +7,7 @@ import { translate } from '../../services/translation.service';
77
styleUrl: 'app-team-landing.scss',
88
})
99
export class AppTeamLanding {
10-
@Prop({ context: 'isServer' })
11-
private isServer: boolean;
12-
13-
private allowWebp;
10+
// private allowWebp = localStorage.getItem('allowWebp') === 'true' ? true : false;
1411

1512
@Prop() match: MatchResults;
1613
@Prop() history: RouterHistory;
@@ -288,8 +285,6 @@ export class AppTeamLanding {
288285
}
289286

290287
componentWillLoad() {
291-
this.allowWebp = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
292-
293288
if (!this.data[this.match.params.member]) {
294289
this.history.push(`/`, {});
295290
} else {
@@ -315,10 +310,10 @@ export class AppTeamLanding {
315310
}
316311

317312
changeImageFormat(img: string) {
318-
if (img && this.allowWebp) {
319-
const idx = img.lastIndexOf('.');
320-
return `${img.substring(0, idx)}.webp`;
321-
}
313+
// if (img && this.allowWebp) {
314+
// const idx = img.lastIndexOf('.');
315+
// return `${img.substring(0, idx)}.webp`;
316+
// }
322317
return img;
323318
}
324319

src/pages/app-toolbox/app-toolbox.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { Component, Prop } from '@stencil/core';
1+
import { Component } from '@stencil/core';
22

33
@Component({
44
tag: 'app-toolbox',
55
styleUrl: 'app-toolbox.scss',
66
})
77
export class AppToolbox {
8-
@Prop({ context: 'isServer' })
9-
private isServer: boolean;
10-
11-
private className;
12-
componentWillLoad() {
13-
this.className = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
14-
}
8+
// private className = localStorage.getItem('allowWebp') === 'true' ? 'webp' : 'hero';
159

1610
scrollToForm() {
1711
const form = document.getElementById('second-content');
@@ -35,7 +29,7 @@ export class AppToolbox {
3529
return (
3630
<div class="toolbox">
3731
{/* header - hero */}
38-
<header class={this.className}>
32+
<header class="hero">
3933
<div class="container">
4034
<div class="row align-items-center">
4135
<div class="col-9 col-md-8 col-lg-9">

0 commit comments

Comments
 (0)