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

Translation 1500 feature deriv prime #5418

Merged
merged 71 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
36bb398
feat: deriv prime page
aswathy-deriv Aug 3, 2023
0fe96c5
fix: prime page changes in atomic approach
aswathy-deriv Aug 3, 2023
ece5518
fix: added the new layout
aswathy-deriv Aug 3, 2023
1896ec6
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 8, 2023
bde1593
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 9, 2023
efcdfca
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 15, 2023
dc552b3
fix: added folder for deriv-prime images
aswathy-deriv Aug 15, 2023
2fdf6ef
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 16, 2023
0bffc42
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 17, 2023
57a7839
fix: prime partner (#5419)
mayuran-deriv Aug 18, 2023
d7a303d
Aswathy/Connectivity reliability (#5442)
aswathy-deriv Aug 18, 2023
750d5ba
Konstantinos / meet us there section (#5440)
konstantinosG-deriv Aug 21, 2023
8bfd101
fix: prime available instruments (#5429)
mayuran-deriv Aug 21, 2023
1b7cd2f
Mitra/1502/chore: :sparkles: add number section for deriv prime (#5436)
mitra-deriv Aug 21, 2023
a9adb2e
fix: folder structure refactor for available instruments
aswathy-deriv Aug 21, 2023
e7f7617
Konstantinos / Why choose deriv prime section (#5430)
konstantinosG-deriv Aug 22, 2023
7ac2b12
fix: removed the flex from index file
aswathy-deriv Aug 22, 2023
33f9ac8
fix: rearranged the deriv prime index file
aswathy-deriv Aug 22, 2023
6541b2e
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 23, 2023
875549a
Translation 1425 your potential (#5437)
fasihali-deriv Aug 23, 2023
3f4858f
fix: removed the flex from index file
aswathy-deriv Aug 23, 2023
2edf2f5
Hasan/Translation 1426 prime commercial plan (#5435)
hasan-deriv Aug 24, 2023
43c7834
Konstantinos / browse our faq (#5461)
konstantinosG-deriv Aug 24, 2023
6cda7e9
Hasan/Translation 1412 deriv prime hero (#5433)
hasan-deriv Aug 24, 2023
ec44b3b
fix: error resolved after merge
aswathy-deriv Aug 24, 2023
4e95acf
fix: merge issues
aswathy-deriv Aug 24, 2023
eac3fcd
Hasan/Translation 00 prime commercial table content fix (#5471)
hasan-deriv Aug 25, 2023
4207b20
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 25, 2023
2585f7a
fix: alignment issues
aswathy-deriv Aug 28, 2023
f51bbf2
Mayuran/get in touch (#5462)
mayuran-deriv Aug 28, 2023
3fb0da2
fix: added the contact us button navigation
aswathy-deriv Aug 28, 2023
4abf9b8
Konstantinos / FAQ SEO (#5481)
konstantinosG-deriv Aug 28, 2023
3a1334b
fix: sonarcloud issue
aswathy-deriv Aug 28, 2023
0056b7f
auto-pull-translation
mitra-deriv Aug 29, 2023
e4f9027
translation: 📚 sync translations from crowdin feature branch
DerivFE Aug 29, 2023
741d3c7
Merge branch 'master' into translation-1500-feature-deriv-prime
mitra-deriv Aug 29, 2023
f5f4f5d
Merge branch 'translation-1500-feature-deriv-prime' of https://github…
mitra-deriv Aug 29, 2023
16f1879
auto-pull-translation
mitra-deriv Aug 30, 2023
2837330
translation: 📚 sync translations from crowdin feature branch
DerivFE Aug 30, 2023
9be7a92
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Aug 30, 2023
912e0f5
Merge branch 'translation-1500-feature-deriv-prime' of https://github…
aswathy-deriv Aug 30, 2023
1c5ae60
auto-pull-translation
aswathy-deriv Aug 30, 2023
38fe51b
fix: vercel deploy issues
aswathy-deriv Aug 30, 2023
091fdce
fix: button issue for contact us
aswathy-deriv Aug 30, 2023
800dd2c
fix: meta issue fix for deriv prime
aswathy-deriv Aug 30, 2023
49cfe73
Hasan/Pr 1780 go to element hook (#5503)
hasan-deriv Aug 30, 2023
593600c
fix: check server side rendering for contact us button
aswathy-deriv Aug 30, 2023
916026f
fix: fix table td line hight (#5508)
fasihali-deriv Aug 31, 2023
a0fa03f
Konstantinos / Deriv Prime final subtasks (#5507)
konstantinosG-deriv Aug 31, 2023
61d7dd5
auto-pull-translation
aswathy-deriv Aug 31, 2023
ae897ee
auto-pull-translation
aswathy-deriv Aug 31, 2023
a6a0584
auto-pull-translation
aswathy-deriv Aug 31, 2023
a0861b3
auto-pull-translation
aswathy-deriv Aug 31, 2023
c6631b1
translation: 📚 sync translations from crowdin feature branch
DerivFE Aug 31, 2023
c6784f3
Mayuran/fix contact us (#5511)
mayuran-deriv Aug 31, 2023
556b594
Mayuran/align issue (#5509)
mayuran-deriv Aug 31, 2023
be9310e
Konstantinos / Box height (#5510)
konstantinosG-deriv Aug 31, 2023
343697b
empty: :rocket: to redeploy and trigger build
aswathy-deriv Aug 31, 2023
d7a60ff
fix: changed the deriv logo
aswathy-deriv Aug 31, 2023
f280395
Merge branch 'translation-1500-feature-deriv-prime' of https://github…
aswathy-deriv Aug 31, 2023
67ab3c7
chore: fix active link in internal links
mohsen-deriv Aug 31, 2023
935feb1
chore: fix prime logo
mohsen-deriv Aug 31, 2023
927c785
Hasan/Pr 00 table refactor (#5515)
hasan-deriv Sep 1, 2023
66bcc6f
fix: merge conflicts
aswathy-deriv Sep 1, 2023
3bd1849
Merge branch 'translation-1500-feature-deriv-prime' of https://github…
aswathy-deriv Sep 1, 2023
aa42cd7
fix: changed the faq question
aswathy-deriv Sep 1, 2023
213acff
auto-pull-translation
aswathy-deriv Sep 1, 2023
477d3ed
auto-pull-translation
aswathy-deriv Sep 1, 2023
da36cfe
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
aswathy-deriv Sep 1, 2023
5baca93
auto-pull-translation
aswathy-deriv Sep 1, 2023
7c029d7
translation: 📚 sync translations from crowdin feature branch
DerivFE Sep 1, 2023
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
161 changes: 152 additions & 9 deletions crowdin/messages.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ export const telegram_url = 'https://t.me/derivdotcomofficial'
export const youtube_url = 'https://www.youtube.com/@deriv'
export const loss_percent = 72

export const contact_us_form_post_data = 'https://formkeep.com/f/7f4b8b55f10f'

export const cookie_key = 'browser_update_alert_modal_shown'
export const browsers_minimum_required_version = {
Chrome: 72,
Expand Down
4 changes: 4 additions & 0 deletions src/common/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const isEmptyObject = (obj: unknown): boolean => {
return is_empty
}

export const trimObjectValues = (obj: { [key: string]: string }): { [key: string]: string } => {
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, value.trim()]))
}

export const scrollTop = () => {
if (isBrowser()) {
document.body.scrollTop = 0
Expand Down
39 changes: 27 additions & 12 deletions src/features/components/atoms/card/card-primary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ import Flex from '../../flex-box'
import Link from '../../link'
import { FlexBoxProps } from '../../flex-box/box'
import { CardType } from '../type'
import { Localize } from 'components/localization'
import { Localize, localize } from 'components/localization'
import dclsx from 'features/utils/dclsx'
import useBreakpoints from 'components/hooks/use-breakpoints'

export interface CardPrimaryProps extends FlexBoxProps<'div'>, CardType {}

const CardPrimary = ({ header, description, icon, link, className, ...rest }: CardPrimaryProps) => {
const CardPrimary = ({
header,
description,
icon,
alt_icon,
link,
className,
is_coming_soon = false,
...rest
}: CardPrimaryProps) => {
const { is_mobile_or_tablet } = useBreakpoints()

return (
Expand All @@ -23,21 +32,27 @@ const CardPrimary = ({ header, description, icon, link, className, ...rest }: Ca
radius="8x"
{...rest}
>
<Flex.Item className={dclsx('item_block')}>
{is_coming_soon && (
<Flex.Box className={dclsx('coming_soon_wrapper')} justify="center" align="center">
<Typography.Paragraph size={'xxs'} weight="bold" textcolor="black">
<Localize translate_text={'_t_Coming soon_t_'} />
</Typography.Paragraph>
</Flex.Box>
)}
<Flex.Item className={dclsx(link && 'item_block')}>
{icon && (
<Flex.Box pb="11x" lg={{ pb: '8x' }}>
<img src={icon} width={44} height={44} />
<img
src={icon}
width={44}
height={44}
alt={alt_icon ? localize(alt_icon) : ''}
/>
</Flex.Box>
)}
<Typography.Paragraph
as="p"
size={is_mobile_or_tablet ? 'large' : 'medium'}
pb="4x"
weight="bold"
font_family="UBUNTU"
>
<Typography.Heading as="h3" size="xxs" pb="4x" weight="bold">
<Localize translate_text={header} />
</Typography.Paragraph>
</Typography.Heading>
<Typography.Paragraph size={is_mobile_or_tablet ? 'medium' : 'small'}>
<Localize translate_text={description} />
</Typography.Paragraph>
Expand Down
2 changes: 2 additions & 0 deletions src/features/components/atoms/card/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export interface CardType {
description: TString
icon?: string
link?: LinkUrlType
is_coming_soon?: boolean
alt_icon?: TString
}
8 changes: 6 additions & 2 deletions src/features/components/atoms/link/internal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useEffect, useState } from 'react'
import { Link } from 'gatsby'
import language_config from '../../../../../i18n-config.js'
import { LinkProps } from '.'
Expand Down Expand Up @@ -66,6 +66,8 @@ const Internal = ({
link_rel,
active_urls,
}: InternalProps) => {
const [is_active, setIsActive] = useState(false)

let rawLocale = 'en'
if (isBrowser()) {
rawLocale = localStorage.getItem('i18n') ?? 'en'
Expand All @@ -77,7 +79,9 @@ const Internal = ({

const to = is_non_localized || is_default ? url.to : `/${path}${url.to}`

const is_active = isActiveLink(url.to, active_urls)
useEffect(() => {
setIsActive(isActiveLink(url.to, active_urls))
}, [active_urls, url.to])

return (
<Link
Expand Down
37 changes: 37 additions & 0 deletions src/features/components/atoms/table/base/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react'
import { TableColumnType } from '../types'
import Box, { BoxProps } from '../../box'
import TableHeader from './table-header'
import TableRow from './table-row'
import dclsx from 'features/utils/dclsx'
import { ClassProps } from 'features/types'

export interface TableProps<T, K extends keyof T> extends BoxProps, ClassProps {
striped?: boolean
layout?: 'fixed' | 'auto'
data: T[]
columns: Array<TableColumnType<T, K>>
}

function BaseTable<T, K extends keyof T>({
data,
columns,
striped,
layout,
className,
...rest
}: TableProps<T, K>) {
return (
<Box
className={dclsx('table-responsive', { ['table-striped']: striped }, className)}
{...rest}
>
<table className={dclsx('table', { [`table-layout-${layout}`]: layout })}>
<TableHeader columns={columns} />
<TableRow data={data} columns={columns} />
</table>
</Box>
)
}

export default BaseTable
35 changes: 35 additions & 0 deletions src/features/components/atoms/table/base/table-header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react'
import { TableColumnType } from '../types'
import dclsx from 'features/utils/dclsx'

type TableHeaderProps<T, K extends keyof T> = {
columns: Array<TableColumnType<T, K>>
}

const TableHeader = <T, K extends keyof T>({ columns }: TableHeaderProps<T, K>) => {
return (
<thead>
<tr>
{columns.map((col) => (
<th
key={col.accessor}
className={dclsx(
'typography-color-black',
'typography-align-center',
'typography-font-UBUNTU',
'typography-weight-bold',
'text-small',
'padding-block-5x',
'padding-inline-10x',
'md-padding-block-6x',
)}
>
{col.header}
</th>
))}
</tr>
</thead>
)
}

export default TableHeader
37 changes: 37 additions & 0 deletions src/features/components/atoms/table/base/table-row.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react'
import { TableColumnType } from '../types'
import dclsx from 'features/utils/dclsx'

type TableRowProps<T, K extends keyof T> = {
data: T[]
columns: Array<TableColumnType<T, K>>
}

const TableRow = <T, K extends keyof T>({ data, columns }: TableRowProps<T, K>) => {
return (
<tbody>
{data.map((row, i) => (
<tr key={i}>
{columns.map((col) => (
<td
key={col.accessor}
className={dclsx(
'typography-color-black',
'typography-align-center',
'typography-font-UBUNTU',
'text-small',
'padding-block-4x',
'padding-inline-10x',
'md-padding-block-6x',
)}
>
{row[col.accessor]}
</td>
))}
</tr>
))}
</tbody>
)
}

export default TableRow
17 changes: 17 additions & 0 deletions src/features/components/atoms/table/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { ReactNode } from 'react'
import BaseTable from './base'
import ShadowTable from './shadow-table'

type BaseTypes = {
Base: typeof BaseTable
Shadow: typeof ShadowTable
}

const Table: BaseTypes = ({ children }: { children: ReactNode }) => {
return <>{children}</>
}

Table.Base = BaseTable
Table.Shadow = ShadowTable

export default Table
9 changes: 9 additions & 0 deletions src/features/components/atoms/table/shadow-table/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'
import BaseTable, { TableProps } from '../base'
import dclsx from 'features/utils/dclsx'

function ShadowTable<T, K extends keyof T>({ className, ...rest }: TableProps<T, K>) {
return <BaseTable className={dclsx('table-shadow', 'padding-12x', className)} {...rest} />
}

export default ShadowTable
6 changes: 6 additions & 0 deletions src/features/components/atoms/table/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ReactNode } from 'react'

export type TableColumnType<T, K extends keyof T> = {
accessor: K extends string ? K : never
header: ReactNode
}
36 changes: 26 additions & 10 deletions src/features/components/molecules/other-markets-slider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Swiper, SwiperSlide } from 'swiper/react'
import { Pagination } from 'swiper'
import { MarketPageType, other_markets_items } from './data'
import { MarketPageType, SmartOtherMarketsItem, other_markets_items } from './data'
import useDynamicVisibleContent from 'components/hooks/use-dynamic-visible-content'
import Flex from 'features/components/atoms/flex-box'
import { Localize } from 'components/localization'
Expand All @@ -10,33 +10,44 @@ import Card from 'features/components/atoms/card'
import './other-markets-slider.scss'
import Container from 'features/components/atoms/container'
import useRegion from 'components/hooks/use-region'
import { TString } from 'types/generics'
import dclsx from 'features/utils/dclsx'

export type OtherMarketSliderProps = {
current_market: MarketPageType
current_market?: MarketPageType
title?: TString
available_markets?: SmartOtherMarketsItem[] | null
}

const OtherMarketsSlider = ({ current_market }: OtherMarketSliderProps) => {
const OtherMarketsSlider = ({
current_market,
title,
available_markets = null,
}: OtherMarketSliderProps) => {
const { is_eu } = useRegion()
const slider_items = useDynamicVisibleContent({
content: other_markets_items,
content: available_markets || other_markets_items,
config: {
current_market: (market_page) => market_page !== current_market,
is_eu: (item_is_eu) => item_is_eu === undefined || is_eu === item_is_eu,
},
})
const is_no_linkAvailable = !!available_markets?.length

return (
<Container.Fixed padding_block="20x" md={{ padding_block: '40x' }}>
<Flex.Box direction="col" gap="12x">
<Typography.Heading
as="h3"
size="small"
as="h2"
size={is_no_linkAvailable ? 'medium' : 'small'}
align="center"
padding_inline="8x"
pb="10x"
lg={{ padding_block: '20x', padding_inline: '40x' }}
>
<Localize translate_text="_t_Other markets you might be interested in_t_" />
<Localize
translate_text={title || '_t_Other markets you might be interested in_t_'}
/>
</Typography.Heading>
</Flex.Box>
<Flex.Box justify="center" align="center">
Expand All @@ -49,18 +60,23 @@ const OtherMarketsSlider = ({ current_market }: OtherMarketSliderProps) => {
clickable: true,
}}
rewind
className={'markets_swiper'}
className={dclsx('markets_swiper', is_no_linkAvailable && 'no_link')}
slidesPerView={'auto'}
>
{slider_items.map(({ id, data }) => {
return (
<SwiperSlide key={id} className={'market_slide'}>
<Card.Primary
className="other_market_item"
className={dclsx(
'other_market_item',
is_no_linkAvailable && 'no_link',
)}
header={data.header}
description={data.description}
icon={data.icon}
link={data.link}
link={data?.link || null}
is_coming_soon={data?.is_coming_soon}
alt_icon={data?.alt_icon}
/>
</SwiperSlide>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

.other_market_item {
min-block-size: 30rem;
&.no_link {
min-block-size: 17.5rem;
@include breakpoints(tablet) {
min-block-size: 21rem;
}
}
}

.markets_swiper {
Expand All @@ -21,6 +27,13 @@
@include breakpoints(tablet) {
min-block-size: 40rem;
}
&.no_link {
min-block-size: 22rem;

@include breakpoints(tablet) {
min-block-size: 25rem;
}
}
}

.markets_slider_pagination {
Expand Down
Loading
Loading