lazy load twitter embed

This commit is contained in:
AykutSarac 2023-01-28 17:38:17 +03:00
parent 07bea63692
commit b8b2472a94
2 changed files with 8 additions and 9 deletions

View File

@ -8,19 +8,18 @@ export const GoogleAnalytics: React.FC = () => {
return (
<>
<Script src="https://www.googletagmanager.com/gtag/js?id=G-JKZEHMJBMH" />
<Script
src="https://www.googletagmanager.com/gtag/js?id=G-JKZEHMJBMH"
strategy="afterInteractive"
/>
<Script id="google-analytics" strategy="afterInteractive">
{`
id="google-analytics"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-JKZEHMJBMH');
`}
</Script>
`,
}}
/>
</>
);
};

View File

@ -201,7 +201,7 @@ const GitHubSection = () => (
April 27, 2022
</a>
</blockquote>{" "}
<Script async src="https://platform.twitter.com/widgets.js" charSet="utf-8"></Script>
<Script strategy="lazyOnload" src="https://platform.twitter.com/widgets.js"></Script>
</Styles.StyledTwitterQuote>
<Styles.StyledSectionArea>
<Styles.StyledSubTitle>Open Source Community</Styles.StyledSubTitle>