Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Revert "Konstantinos/DERC-2019/Performance,accessibility score improv…
Browse files Browse the repository at this point in the history
…ement (#6028)" (#6051)

This reverts commit 97383aa.
  • Loading branch information
habib-deriv authored Nov 27, 2023
1 parent 4476a31 commit 5a17e66
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 49 deletions.
3 changes: 0 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ module.exports = {
`https://assets.customer.io/assets/track.js`,
`https://static.deriv.com/scripts/cookie.js`,
`https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js`,
`https://cdn.livechatinc.com/tracking.js`,
`https://www.google-analytics.com/analytics.js`,
`https://www.googletagmanager.com/gtm.js?id=${process.env.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID}`,
],
plugins: [
// [TODO] Enable this when we have a proper setup to enable caching, Otherwise it will cause one of them stop working.
Expand Down
5 changes: 0 additions & 5 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
const language_config = require(`./i18n-config.js`)
const language_config_en = require(`./i18n-config-en.js`)
const path = require('path')
const { copyLibFiles } = require('@builder.io/partytown/utils')

const translations_cache = {}

exports.onPreBuild = async () => {
await copyLibFiles(path.join(__dirname, 'static', '~partytown'))
}
// Based upon https://github.com/gatsbyjs/gatsby/tree/master/examples/using-i18n
exports.onCreatePage = ({ page, actions }) => {
const { createRedirect, createPage, deletePage } = actions
Expand Down
40 changes: 18 additions & 22 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import React from 'react'
import { Partytown } from '@builder.io/partytown/react'
import { WrapPagesWithLocaleContext } from './src/components/localization'
import './src/components/localization/config'
import GlobalProvider from './src/store/global-provider'

export const wrapRootElement = ({ element }) => {
return <GlobalProvider>{element}</GlobalProvider>
return <GlobalProvider>{element}</GlobalProvider>
}

export const wrapPageElement = WrapPagesWithLocaleContext

export const onRenderBody = ({ setHeadComponents }) => {
const gtmTrackingId = process.env.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID || ''
const gtmTrackingId = process.env.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID || ''

setHeadComponents([
<Partytown key="partytown" forward={['dataLayer.push']} />,
<script
key="partytown-vanilla-config"
type="text/partytown"
dangerouslySetInnerHTML={{
__html: `partytown = {
setHeadComponents([
<script
key="partytown-vanilla-config"
dangerouslySetInnerHTML={{
__html: `partytown = {
resolveUrl(url, location) {
// Use a secure connection
if (url?.protocol === 'http:') {
Expand All @@ -31,16 +28,15 @@ export const onRenderBody = ({ setHeadComponents }) => {
return proxyUrl
}
}`,
}}
/>,
gtmTrackingId && (
<script
key="gtm-script"
type="text/partytown"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl+'';f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer', '${gtmTrackingId}');`,
}}
/>
),
])
}}
/>,
gtmTrackingId && (
<script
key="gtm-script"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl+'';f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer', '${gtmTrackingId}');`,
}}
/>
),
])
}
18 changes: 3 additions & 15 deletions package-lock.json

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

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"author": "Deriv",
"dependencies": {
"@artsy/fresnel": "^6.1.0",
"@builder.io/partytown": "^0.8.1",
"@deriv/analytics": "^1.3.4",
"@deriv/deriv-api": "^1.0.11",
"@hookform/resolvers": "^3.0.1",
Expand Down Expand Up @@ -148,7 +147,6 @@
"scripts": {
"analyze-bundle": "GENERATE_JSON_STATS=true gatsby build && npx webpack-bundle-analyzer -m static -r ./webpack-bundle-report/report.html ./public/stats.json",
"build": "GATSBY_CPU_COUNT=2 gatsby build --log-pages",
"partytown": "partytown copylib public/~partytown",
"develop": "GATSBY_CPU_COUNT=2 gatsby develop -o",
"format": "prettier --write '**/*.js' '*.js'",
"stylelint": "stylelint 'src/**/*.js' --formatter verbose",
Expand Down
1 change: 0 additions & 1 deletion src/components/hooks/use-livechat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const useLivechat = (): [boolean, TLC_API] => {

const loadLiveChatScript = (callback) => {
const livechat_script = document.createElement('script')
livechat_script.type = 'text/partytown'
livechat_script.innerHTML = `
window.__lc = window.__lc || {};
window.__lc.license = ${licence_key};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const LanguageSwitcher = () => {
onOpenChange={setOpen}
>
<DropdownMenu.Trigger asChild>
<div role="button" className={styles.trigger}>
<div className={styles.trigger}>
<Typography.Paragraph size="medium" font_family={'UBUNTU'} weight="bold">
{currentLang.short_name}
</Typography.Paragraph>
Expand Down
Binary file modified src/images/common/awards/best-forex-spreads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/awards/broker-of-the-year.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/awards/gptw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/awards/investors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/awards/most-trusted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/home/eu_hero_person_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/home/hero_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/home/hero_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/home/hero_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/common/home/hero_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 5a17e66

@vercel
Copy link

@vercel vercel bot commented on 5a17e66 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com-git-master.binary.sx
deriv-com.binary.sx

Please sign in to comment.