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

Revert "Deriv.com New Homepage 🌐" #6840

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
"pattern": "features/components/templates/layout",
"group": "parent",
"position": "after"
},
{
"pattern": "features/components/quill/quill-layout",
"group": "parent",
"position": "after"
}
],
"newlines-between": "never"
Expand Down
243 changes: 72 additions & 171 deletions crowdin/messages.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ import {
updateURLAsPerUserLanguage,
} from 'common/utility'
import './static/css/noto-sans-arabic.css'
import 'swiper/swiper-bundle.min.css'
import 'features/styles/app.scss'
import './static/css/ubuntu.css'
import './static/css/global.css'
import '@deriv-com/blocks/style.css';
import '@deriv-com/blocks/style.css'
import '@deriv-com/components/style.css'

const is_browser = typeof window !== 'undefined'

Expand Down
29 changes: 1 addition & 28 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,12 @@
const language_config_en = require(`./i18n-config-en.js`)
const path = require('path')
const { copyLibFiles } = require('@builder.io/partytown/utils')
const { exec } = require('child_process')
const translations_cache = {}

function OSFunction() {
this.execCommand = function (cmd, callback) {
exec(cmd, (error, stdout) => {
if (error) {
console.error(`exec error: ${error}`)
return
}

callback(stdout)
})
}
}

const fetchTrustpilotData = () => {
// Trustpilot on-build data fetching
const os = new OSFunction()

os.execCommand('node scripts/trustpilot.js', (returnvalue) => {
console.log(returnvalue)
})
}
const translations_cache = {}

exports.onPreBuild = async () => {
await copyLibFiles(path.join(__dirname, 'static', '~partytown'))
}
exports.onPreInit = () => {
// Update truspilot.json file with latest data
fetchTrustpilotData()
}

// Based upon https://github.com/gatsbyjs/gatsby/tree/master/examples/using-i18n

const BuildPage = (page, actions) => {
Expand Down Expand Up @@ -392,7 +365,7 @@
}
}, [])

console.log('pages', pages)

Check warning on line 368 in gatsby-node.js

View workflow job for this annotation

GitHub Actions / ESLint

gatsby-node.js#L368

Unexpected console statement (no-console)

deletePage(page)
if (isProduction) {
Expand Down
1,519 changes: 525 additions & 994 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"dependencies": {
"@artsy/fresnel": "^6.2.1",
"@builder.io/partytown": "^0.8.1",
"@deriv-com/blocks": "^0.79.0",
"@deriv-com/components": "^0.47.0",
"@deriv-com/blocks": "^0.73.0",
"@deriv-com/components": "^0.43.0",
"@deriv-com/hooks": "^0.10.0",
"@deriv-com/providers": "^0.11.0",
"@deriv/analytics": "^1.4.4",
"@deriv/analytics": "^1.4.3",
"@deriv/deriv-api": "^1.0.13",
"@deriv/quill-design": "^1.2.16",
"@deriv/quill-icons": "^1.1.13",
"@deriv/quill-design": "^1.3.2",
"@deriv/quill-icons": "^1.1.5",
"@hookform/resolvers": "^3.3.2",
"@livechat/customer-sdk": "^3.1.5",
"@loadable/component": "^5.15.3",
Expand Down Expand Up @@ -63,7 +63,7 @@
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-date-picker": "8.4.0",
"react-device-detect": "^2.2.3",
"react-device-detect": "^2.2.2",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"react-i18next": "^11.18.6",
Expand Down Expand Up @@ -159,9 +159,7 @@
"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",
"update:deriv-com-libs": "npm i @deriv-com/blocks@latest @deriv-com/components@latest @deriv-com/hooks@latest @deriv-com/providers@latest @deriv/quill-design@latest",
"update:quill-libs": "npm i @deriv/quill-design@latest @deriv/quill-icons@latest",
"update:all-libs": "npm run update:quill-libs; npm run update:deriv-com-libs",
"update:deriv-com-libs": "npm i @deriv-com/blocks@latest @deriv-com/components@latest @deriv-com/hooks@latest @deriv-com/providers@latest",
"partytown": "partytown copylib public/~partytown",
"develop": "GATSBY_CPU_COUNT=2 gatsby develop -o",
"format": "prettier --write '**/*.js' '*.js'",
Expand Down Expand Up @@ -210,8 +208,5 @@
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
},
"optionalDependencies": {
"@parcel/watcher-linux-x64-glibc": "^2.3.0"
}
}
72 changes: 0 additions & 72 deletions scripts/trustpilot.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/data/trustpilot.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ const icons: AccordionIcons = {

const AccordionItem = React.forwardRef<HTMLDivElement, TAccordionItem>(
({ children, className, item_title, icon_type = 'chevron', ...props }, ref) => (
<Accordion.Item className={'at-accordion_item'} ref={ref} {...props}>
<Accordion.Item className={'accordion_item'} ref={ref} {...props}>
<Accordion.Header>
<Accordion.Trigger className={dclsx('at-accordion_trigger', 'at-bg-color-primary')}>
<Accordion.Trigger className={dclsx('accordion_trigger', 'bg-color-primary')}>
<Typography.Heading size={'xs'}>
<Localize translate_text={item_title} />
</Typography.Heading>
<Icon
src={icons[icon_type]}
className={'at-accordion_icon'}
className={'accordion_icon'}
alt={'chevron'}
size={'large'}
/>
</Accordion.Trigger>
</Accordion.Header>
<Accordion.Content className={dclsx('at-accordion_content', className)}>
<Accordion.Content className={dclsx('accordion_content', className)}>
<div className="AccordionContentText">{children}</div>
</Accordion.Content>
</Accordion.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const AccordionRoot = React.forwardRef<
>(({ className, ...rest }, ref) => {
return (
<Accordion.Root
className={dclsx(className, 'at-accordion_root', 'at-bg-color-primary')}
className={dclsx(className, 'accordion_root', 'bg-color-primary')}
{...rest}
ref={ref}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ interface TAccordionItem extends AccordionItemProps {

const AccordionShadowItem = React.forwardRef<HTMLDivElement, TAccordionItem>(
({ children, className, renderHeader, item_title, icon_type = 'chevron', ...props }, ref) => (
<Accordion.Item
className={'at-accordion_item at-accordion_shadow_item'}
ref={ref}
{...props}
>
<Accordion.Item className={'accordion_item accordion_shadow_item'} ref={ref} {...props}>
<Accordion.Header>
<Accordion.Trigger
className={dclsx(
'at-accordion_trigger at-accordion_shadow_item_trigger',
'at-bg-color-primary',
'at-padding-block-8x',
'at-border-radius-4x',
'accordion_trigger accordion_shadow_item_trigger',
'bg-color-primary',
'padding-block-8x',
'border-radius-4x',
)}
>
{renderHeader ? (
Expand All @@ -40,20 +36,17 @@ const AccordionShadowItem = React.forwardRef<HTMLDivElement, TAccordionItem>(
{icon_type === 'chevron' ? (
<Icon
src={Chevron}
className={'at-accordion_icon'}
className={'accordion_icon'}
alt={'chevron'}
size={'large'}
/>
) : (
<span className="at-accordion_icon at-plus_icon" />
<span className="accordion_icon plus_icon" />
)}
</Accordion.Trigger>
</Accordion.Header>
<Accordion.Content
className={dclsx(
'at-accordion_content at-accordion_shadow_item_content',
className,
)}
className={dclsx('accordion_content accordion_shadow_item_content', className)}
>
<div className="AccordionContentText">{children}</div>
</Accordion.Content>
Expand Down
4 changes: 2 additions & 2 deletions src/features/components/atoms/alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const Alert = ({
return (
<AlertDialog.Root defaultOpen>
<AlertDialog.Portal>
<AlertDialog.Overlay className="at-alert-overlay" />
<AlertDialog.Content className="at-alert-content">
<AlertDialog.Overlay className="alert-overlay" />
<AlertDialog.Content className="alert-content">
<AlertDialog.Title asChild className="AlertDialogTitle">
<div>
<Typography.Heading as="h3" size="xxs" pb="12x">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const CardPrimary = ({
)}
<Typography.Heading
as="h3"
className={dclsx(is_mobile_or_tablet ? 'at-text-large' : 'at-text-medium')}
className={dclsx(is_mobile_or_tablet ? 'text-large' : 'text-medium')}
pb="4x"
weight="bold"
>
Expand Down
2 changes: 1 addition & 1 deletion src/features/components/atoms/container/fixed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ContentSectionTagOptions } from 'features/types'
import dclsx from 'features/utils/dclsx'

const FixedContainer = ({ className, ...rest }: BoxProps<ContentSectionTagOptions>) => {
const classnames = dclsx(className, 'at-container-fixed')
const classnames = dclsx(className, 'container-fixed')

return <Box className={classnames} {...rest} />
}
Expand Down
2 changes: 1 addition & 1 deletion src/features/components/atoms/container/fluid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ContentSectionTagOptions } from 'features/types'
import dclsx from 'features/utils/dclsx'

const FluidContainer = ({ className, ...rest }: BoxProps<ContentSectionTagOptions>) => {
const classnames = dclsx(className, 'at-container-fluid')
const classnames = dclsx(className, 'container-fluid')

return <Box className={classnames} {...rest} />
}
Expand Down
14 changes: 7 additions & 7 deletions src/features/components/atoms/flex-box/box/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const generateFlexClasses = (options: FlexBoxClasses, prefix?: string) => {
const classPrefix = prefix ? `${prefix}-` : ''

return dclsx({
[`${classPrefix}at-gap-${gap}`]: gap,
[`${classPrefix}at-align-items-${align}`]: align,
[`${classPrefix}at-justify-${justify}`]: justify,
[`${classPrefix}at-flex-wrap-${wrap}`]: wrap,
[`${classPrefix}at-flex-dir-${direction}`]: direction,
[`${classPrefix}gap-${gap}`]: gap,
[`${classPrefix}align-items-${align}`]: align,
[`${classPrefix}justify-${justify}`]: justify,
[`${classPrefix}flex-wrap-${wrap}`]: wrap,
[`${classPrefix}flex-dir-${direction}`]: direction,
})
}

Expand All @@ -59,10 +59,10 @@ const FlexBoxContainer = <T extends ContentSectionTagOptions>({
...rest
}: FlexBoxProps<T>) => {
const classnames = dclsx(
'at-flex',
'flex',
className,
{
[`at-container-${container}`]: container,
[`container-${container}`]: container,
},
generateFlexItemClasses({ align_self, grow, shrink, basis }),
generateFlexItemClasses(md ?? {}, 'md'),
Expand Down
8 changes: 4 additions & 4 deletions src/features/components/atoms/flex-box/item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const generateFlexItemClasses = (options: FlexItemClasses, prefix = '') =
const classPrefix = prefix ? `${prefix}-` : ''
const { align_self, grow, shrink, basis } = options
return dclsx({
[`${classPrefix}at-align-self-${align_self}`]: align_self,
[`${classPrefix}at-flex-grow-${grow}`]: grow,
[`${classPrefix}at-flex-shrink-${shrink}`]: shrink,
[`${classPrefix}at-flex-basis-${basis}`]: basis,
[`${classPrefix}align-self-${align_self}`]: align_self,
[`${classPrefix}flex-grow-${grow}`]: grow,
[`${classPrefix}flex-shrink-${shrink}`]: shrink,
[`${classPrefix}flex-basis-${basis}`]: basis,
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/features/components/atoms/icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ interface IconProps extends ImgHTMLAttributes<'img'>, ClassProps {
}

const Icon = ({ size = 'small', has_rtl, className, ...rest }: IconProps) => {
const classnames = dclsx(className, `at-icon-${size}`, 'at-icon', {
'at-icon-rtl': has_rtl,
const classnames = dclsx(className, `icon-${size}`, 'icon', {
'icon-rtl': has_rtl,
})

return <Box as={'img'} className={classnames} {...rest} />
Expand Down
2 changes: 1 addition & 1 deletion src/features/components/atoms/input/checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const CheckboxInput = forwardRef<HTMLInputElement, InputHTMLAttributes<HTMLInput
return (
<Typography.Paragraph
as="label"
className={dclsx(className, 'at-checkbox_input_container')}
className={dclsx(className, 'checkbox_input_container')}
>
<input type={'checkbox'} {...rest} ref={ref} />
{children}
Expand Down
Loading
Loading