Skip to content

Commit

Permalink
fix(gtm): use next/scrip
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin.apolinario committed Nov 3, 2023
1 parent 9696f1b commit 5c3a278
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
2 changes: 2 additions & 0 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function App({ Component, pageProps }) {
<Head>
{GTM_ID && (
<script
id="gtm-script"
defer
dangerouslySetInnerHTML={{
__html: `
Expand All @@ -80,6 +81,7 @@ export default function App({ Component, pageProps }) {
)}

<script
id="zi-script"
defer
dangerouslySetInnerHTML={{
__html: `
Expand Down
32 changes: 11 additions & 21 deletions src/revamp/ui/HeroV2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { generateAlt } from 'utils';
import { useEffect, useState } from 'react';
import { FONT_FAMILY } from 'components/globals/constants';
import dynamic from 'next/dynamic';
import { LazyLoadImage } from 'react-lazy-load-image-component';

const Logos = dynamic(() => import('./Logos'), {
ssr: false,
Expand Down Expand Up @@ -249,27 +248,18 @@ const Hero = ({
},
})}
>
{!isLg ? (
<picture>
<source srcSet={media + '?width=400'} media="(min-width: 400px)" />
<img
height={320}
width={400}
src={heroImage}
style={{ width: '100%', height: 'auto' }}
alt={generateAlt('Zesty image')}
loading="eager"
/>
</picture>
) : (
<LazyLoadImage
alt={generateAlt('Zesty-Hero')}
srcSet={heroImage}
effect="blur"
height={940}
width={1500}
<picture>
<source srcSet={media} media="(min-width: 1200px)" />
<source srcSet={media + '?width=400'} media="(min-width: 400px)" />
<img
height={900}
width={1400}
src={heroImage}
style={{ width: '100%', height: 'auto' }}
alt={generateAlt('Zesty image')}
loading="eager"
/>
)}
</picture>
</Box>
</Box>
);
Expand Down

0 comments on commit 5c3a278

Please sign in to comment.