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

Fasih/without translation PR enable firebase live price trans #5794

Merged
2 changes: 1 addition & 1 deletion crowdin/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@
"274438767": "The order amount is locked in escrow until both parties confirm that the transaction has been completed from their end.",
"275116637": "Deriv X",
"275316510": "Impersonators ask you to send confidential information over an unsecure platform, for example via SMS, WhatsApp, email, etc.",
"276089446": "All spreads are indicative. To view real-time spreads, please refer to your terminal.",
"276482397": "No, you can't.",
"278499050": "Use your local currency to make deposits into and withdrawals from your Deriv account.",
"281247370": "Margin Calculator",
Expand Down Expand Up @@ -3162,6 +3161,7 @@
"-1026502273": "One broker,",
"-1981735781": "One broker, countless trading opportunities",
"-1722031734": "Check trading specs",
"-61718257": "Speculate on the price movements of popular exchange-traded funds (ETFs). Diversify your portfolio with assets that track bonds, commodities, and indices, without the high cost of owning the underlying assets.",
"-777850431": "View all >",
"-1384760133": "Bid price",
"-1882694284": "Ask price",
Expand Down
2 changes: 1 addition & 1 deletion src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,5 @@ export const bannerTypes = {
}

export const firebaseConfig = {
databaseURL: 'https://deriv-static-pricingfeed.firebaseio.com',
databaseURL: 'https://deriv-static-pricingfeedv2.firebaseio.com',
}
351 changes: 183 additions & 168 deletions src/components/elements/symbols-shortcode.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/hooks/use-pricing-feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const usePricingFeed = () => {
const app = initializeApp(firebaseConfig)
const db = getDatabase(app)

const commoditiesRef = ref(db, is_eu ? 'eu/market' : 'row/market')
const commoditiesRef = ref(db, is_eu ? 'eu/mkt' : 'row/mkt')
const unsubscribe = onValue(
commoditiesRef,
(snapshot) => {
Expand Down
11 changes: 1 addition & 10 deletions src/features/pages/home/live-pricing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ const LivePricing = () => {
return (
<Container.Fixed as="section" pt="16x" pb="16x" md={{ padding_block: '40x' }}>
<MarketTab />
<Flex.Box justify="center" align="center" padding="16x">
<Typography.Paragraph
align="center"
font_family="UBUNTU"
textcolor="secondary"
size="medium"
>
<Localize translate_text="_t_All spreads are indicative. To view real-time spreads, please refer to your terminal._t_" />
</Typography.Paragraph>
</Flex.Box>
<Flex.Box
justify="center"
align="center"
gap="4x"
direction="col"
pt="16x"
md={{ direction: 'row', gap: '10x' }}
>
<LinkButton.Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import TabMenu from 'features/components/templates/tabs/menu'
import { PathType } from 'features/types'

const MarketTab = () => {
const [selected_market, setSelectedMarket] = useState<TAvailableLiveMarkets>('forex')
const [selected_market, setSelectedMarket] = useState<TAvailableLiveMarkets>('fx')
const [tab_name, setTabName] = useState('Forex')
const [linkToMarketPage, setLinkToMarketPage] = useState<PathType>('/markets/forex/')
const onMarketButtonClick = (selected) => {
Expand Down
21 changes: 16 additions & 5 deletions src/features/pages/home/live-pricing/market-tabs/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { TMarketButtons } from '../types'
import Forex from 'images/svg/home/ts_fx_icon.svg'
import Derived from 'images/svg/home/ts_derived_icon.svg'
import Stocks from 'images/svg/home/ts_stocks_icon.svg'
import ETFS from 'images/svg/home/ts_etfs.svg'
import Crypto from 'images/svg/home/ts_crypto_icon.svg'
import Commodities from 'images/svg/home/ts_commodities_icon.svg'
import SelectedForex from 'images/svg/home/selected_ts_fx_icon.svg'
import SelectedDerived from 'images/svg/home/selected_ts_derived_icon.svg'
import SelectedStocks from 'images/svg/home/selected_ts_stocks_icon.svg'
import SelectedETFS from 'images/svg/home/selected_etfs.svg'
import SelectedCrypto from 'images/svg/home/selected_ts_crypto_icon.svg'
import SelectedCommodities from 'images/svg/home/selected_ts_commodities_icon.svg'

Expand All @@ -15,7 +17,7 @@ export const market_buttons: TMarketButtons[] = [
src: Forex,
selected_src: SelectedForex,
button_text: 'Forex',
market_name: 'forex',
market_name: 'fx',
market_description:
'_t_Benefit from round-the-clock trading hours (Monday to Friday), high liquidity, low barriers to entry, a wide range of offerings, and opportunities to trade on world events._t_',
to: '/markets/forex/',
Expand All @@ -24,7 +26,7 @@ export const market_buttons: TMarketButtons[] = [
src: Derived,
selected_src: SelectedDerived,
button_text: 'Derived indices',
market_name: 'derived',
market_name: 'der',
market_description:
'_t_Trade on asset prices derived from real-world or simulated markets. Manage your exposure by selecting the volatility level to suit your risk appetite. Choose from our 24/7 synthetics, derived FX, and baskets._t_',
to: '/markets/synthetic/',
Expand All @@ -33,16 +35,25 @@ export const market_buttons: TMarketButtons[] = [
src: Stocks,
selected_src: SelectedStocks,
button_text: 'Stocks & indices',
market_name: 'indices',
market_name: 'ind',
market_description:
'_t_Trade global stocks of your favourite household brands and international stock market indices on Deriv. Expand your trading opportunities with access to a wide range of stocks and indices at competitive prices, and the convenience to trade indices beyond standard market hours._t_',
to: '/markets/stock/',
},
{
src: ETFS,
selected_src: SelectedETFS,
button_text: 'ETFs',
market_name: 'etfs',
market_description:
'_t_Speculate on the price movements of popular exchange-traded funds (ETFs). Diversify your portfolio with assets that track bonds, commodities, and indices, without the high cost of owning the underlying assets._t_',
to: '/markets/exchange-traded-funds/',
},
{
src: Crypto,
selected_src: SelectedCrypto,
button_text: 'Cryptocurrencies',
market_name: 'cryptocurrency',
market_name: 'cry',
market_description:
"_t_Take advantage of a highly liquid market with round-the-clock trading. Profit from correctly predicting the movement of world's most popular cryptocurrencies._t_",
to: '/markets/cryptocurrencies/',
Expand All @@ -51,7 +62,7 @@ export const market_buttons: TMarketButtons[] = [
src: Commodities,
selected_src: SelectedCommodities,
button_text: 'Commodities',
market_name: 'commodities',
market_name: 'com',
market_description:
'_t_Speculate on the price movements of silver, gold, oil and more. Profit from the price difference when the market moves in the direction that you have predicted._t_',
to: '/markets/commodities/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const LiveMarketTable = ({ selected_market, link_to }: TLiveMarketTableProps) =>

const markets_data = useMemo(() => {
if (rawMarketsData) {
const stocks = rawMarketsData['stocks']
const indices = rawMarketsData['indices']
const stocks = rawMarketsData['stk']
const indices = rawMarketsData['ind']
const stocks_indices = { ...stocks, ...indices }
const res = { ...rawMarketsData, indices: stocks_indices }
const res = { ...rawMarketsData, ind: stocks_indices }

if (res[selected_market]) {
return Object.values(res[selected_market])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import * as icons from 'components/elements/symbols-shortcode'
import Image from 'features/components/atoms/image'

const SymbolIcon = ({ icon_src, alt }: { icon_src: string; alt?: string }) => {
if (icon_src === '1HZ150V')
if (icon_src === 'Volatility_150_(1s)_Index')
return <Image src={icons['Vol_1HZ150V']} width="24px" height="24px" alt={alt} />
if (icon_src === '1HZ250V')
if (icon_src === 'Volatility_250_(1s)_Index')
return <Image src={icons['Vol_1HZ250V']} width="24px" height="24px" alt={alt} />
else return <Image src={icons[icon_src]} width="24px" height="24px" alt={alt} />
}
Expand Down
23 changes: 6 additions & 17 deletions src/features/pages/home/live-pricing/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,14 @@ import { TString } from 'types/generics'
export type TMarketData = {
ask: number
bid: number
day_percentage_change: number
market: string
spread: number
symbol: string
shortcode: string
chng: number
mkt: string
sprd: number
sym: string
code: string
}

export type TMarketDataResponse = {
trading_platform_asset_listing: any
active_symbols: TMarketData[]
req_id: number
}

export type TAvailableLiveMarkets =
| 'forex'
| 'derived'
| 'indices'
| 'cryptocurrency'
| 'commodities'
export type TAvailableLiveMarkets = 'fx' | 'der' | 'ind' | 'cry' | 'com' | 'etfs'

export type TMarketButtons = {
src: string
Expand Down
20 changes: 12 additions & 8 deletions src/features/pages/home/live-pricing/use-live-columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const useLiveColumns = () => {
const { is_mobile } = useBreakpoints()
const columns = useMemo(() => {
return [
liveMarketColumnHelper.accessor('shortcode', {
liveMarketColumnHelper.accessor('code', {
header: () => (
<Flex.Box>
<Typography.Paragraph
Expand All @@ -28,14 +28,18 @@ const useLiveColumns = () => {
),
cell: (info) => (
<Flex.Box>
<SymbolIcon
icon_src={info.getValue()}
alt={info.row._valuesCache.sym as string}
/>
{info.row.original.mkt !== 'etfs' ? (
<SymbolIcon
icon_src={info.getValue()}
alt={info.row._valuesCache.sym as string}
/>
) : (
<SymbolIcon icon_src="ETFSICON" />
)}
</Flex.Box>
),
}),
liveMarketColumnHelper.accessor('symbol', {
liveMarketColumnHelper.accessor('sym', {
header: () => (
<Flex.Box>
<p className="sr-only">Symbol</p>
Expand Down Expand Up @@ -91,7 +95,7 @@ const useLiveColumns = () => {
</Flex.Box>
),
}),
liveMarketColumnHelper.accessor('spread', {
liveMarketColumnHelper.accessor('sprd', {
header: () => (
<Flex.Box>
<Typography.Paragraph
Expand All @@ -112,7 +116,7 @@ const useLiveColumns = () => {
</Flex.Box>
),
}),
liveMarketColumnHelper.accessor('day_percentage_change', {
liveMarketColumnHelper.accessor('chng', {
header: () => (
<Flex.Box>
<Typography.Paragraph
Expand Down
16 changes: 16 additions & 0 deletions src/images/svg/symbols/etf-usd-500.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/translations/ach.json
Original file line number Diff line number Diff line change
Expand Up @@ -4568,4 +4568,4 @@
"-1165835520": "crwdns459708:0crwdne459708:0",
"-651384976": "crwdns459712:0crwdne459712:0",
"-1033881248": "crwdns2198943:0crwdne2198943:0"
}
}
3 changes: 2 additions & 1 deletion src/translations/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "وسيط واحد،",
"-1981735781": "وسيط واحد وفرص تداول لا حصر لها",
"-1722031734": "تحقق من مواصفات التداول",
"-61718257": "قم بالمضاربة على تحركات أسعار الصناديق الشائعة المتداولة في البورصة (ETFs). قم بتنويع محفظتك باستخدام الأصول التي تتبع السندات والسلع والمؤشرات، دون التكلفة العالية لامتلاك الأصول الأساسية.",
"-777850431": "عرض الكل >",
"-1384760133": "سعر العطاء",
"-1882694284": "اسأل عن السعر",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "موظف",
"-651384976": "الجنسيات",
"-1033881248": "شاهد صفقاتنا المفتوحة"
}
}
3 changes: 2 additions & 1 deletion src/translations/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "একক ব্রোকার,",
"-1981735781": "এক ব্রোকার, অগণিত ট্রেডিং সুযোগ",
"-1722031734": "ট্রেডিং স্পেস চেক করুন",
"-61718257": "জনপ্রিয় এক্সচেঞ্জ-ট্রেডেড তহবিলের মূল্য আন্দোলনের (ETF) সম্পর্কে ধারণা করুন। অন্তর্নিহিত সম্পদের মালিকানাধীন উচ্চ খরচ ছাড়াই বন্ড, পণ্য এবং সূচকগুলি ট্র্যাক করে এমন সম্পদের সাথে আপনার পোর্টফোলিওকে বৈচিত্রপূর্ণ করুন।",
"-777850431": "সব দেখুন>",
"-1384760133": "বিড মূল্য",
"-1882694284": "মূল্য জিজ্ঞাসা করুন",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "কর্মচারী",
"-651384976": "জাতীয়তা",
"-1033881248": "আমাদের ওপেন পজিশন দেখুন"
}
}
3 changes: 2 additions & 1 deletion src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "Ein Broker,",
"-1981735781": "Ein Broker, unzählige Handelsmöglichkeiten",
"-1722031734": "Überprüfen Sie die Handelsspezifikationen",
"-61718257": "Spekulieren Sie auf die Kursbewegungen von beliebten börsengehandelten Fonds (ETFs). Diversifizieren Sie Ihr Portfolio mit Anlagen, die Anleihen, Rohstoffe und Indizes nachbilden, ohne die hohen Kosten für den Besitz der zugrunde liegenden Vermögenswerte.",
"-777850431": "Alles ansehen >",
"-1384760133": "Gebotspreis",
"-1882694284": "Briefkurs",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "Mitarbeiter",
"-651384976": "Nationalitäten",
"-1033881248": "Sehen Sie unsere offenen Stellen"
}
}
3 changes: 2 additions & 1 deletion src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "Un bróker,",
"-1981735781": "Un bróker, innumerables oportunidades de operación",
"-1722031734": "Consulte las especificaciones para operar",
"-61718257": "Especule con los movimientos de precios de los fondos cotizados (ETF) más populares. Diversifique su cartera con activos que replican bonos, materias primas e índices, sin el elevado coste de poseer los activos subyacentes.",
"-777850431": "Ver todo >",
"-1384760133": "Precio de compra",
"-1882694284": "Precio de venta",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "empleados",
"-651384976": "nacionalidades",
"-1033881248": "Vea nuestros puestos disponibles"
}
}
3 changes: 2 additions & 1 deletion src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "Un broker,",
"-1981735781": "Un broker, d'innombrables opportunités de trading",
"-1722031734": "Vérifiez les spécifications de trading",
"-61718257": "Spéculez sur les mouvements de prix des fonds négociés en bourse (FNB) les plus populaires. Diversifiez votre portefeuille avec des actifs qui suivent les obligations, les matières premières et les indices, exempté du coût élevé de la détention des actifs sous-jacents.",
"-777850431": "Tout afficher >",
"-1384760133": "Cours acheteur",
"-1882694284": "Cours vendeur",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "employés",
"-651384976": "nationalités",
"-1033881248": "Voir nos postes vacants"
}
}
3 changes: 2 additions & 1 deletion src/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "Un broker,",
"-1981735781": "Un broker, innumerevoli opportunità di trading",
"-1722031734": "Controlla le specifiche di trading",
"-61718257": "Speculare sui movimenti di prezzo dei popolari exchange-traded funds (ETF). Diversifica il suo portafoglio con attività che seguono le obbligazioni, le materie prime e gli indici, senza il costo elevato di possedere le attività sottostanti.",
"-777850431": "Visualizza tutto >",
"-1384760133": "Prezzo dell'offerta",
"-1882694284": "Prezzo di domanda",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "dipendenti",
"-651384976": "nazionalità",
"-1033881248": "Vedi le posizioni aperte"
}
}
3 changes: 2 additions & 1 deletion src/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "단일 브로커,",
"-1981735781": "한 명의 브로커, 수많은 거래 기회",
"-1722031734": "거래 스펙 확인",
"-61718257": "인기있는 상장지수펀드(ETF)의 가격 변동을 예측해 보세요. 기초자산을 소유하는 높은 비용 없이 채권, 원자재 및 지수를 추적하는 자산으로 귀하의 포트폴리오를 다양화하세요.",
"-777850431": "전체 보기 >",
"-1384760133": "매수 가격",
"-1882694284": "매도 가격",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "직원",
"-651384976": "출신 국적",
"-1033881248": "채용 정보 보기"
}
}
3 changes: 2 additions & 1 deletion src/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "Jeden broker,",
"-1981735781": "Jeden broker, niezliczone możliwości handlowe",
"-1722031734": "Sprawdź specyfikacje handlowe",
"-61718257": "Spekulowanie na ruchach cen popularnych funduszy giełdowych (ETF). Dywersyfikacja portfela za pomocą aktywów, które śledzą obligacje, towary i indeksy, bez wysokich kosztów posiadania aktywów bazowych.",
"-777850431": "Wyświetl wszystko >",
"-1384760133": "Cena oferowana",
"-1882694284": "Cena ofertowa",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "pracowników",
"-651384976": "narodowości",
"-1033881248": "Zobacz nasze otwarte pozycje"
}
}
2 changes: 1 addition & 1 deletion src/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -4568,4 +4568,4 @@
"-1165835520": "funcionários",
"-651384976": "nacionalidades",
"-1033881248": "Consulte as nossas vagas"
}
}
3 changes: 2 additions & 1 deletion src/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,7 @@
"-1026502273": "Один брокер,",
"-1981735781": "Один брокер, множество торговых возможностей",
"-1722031734": "Торговые спецификации",
"-61718257": "Спекулируйте на движении цен популярных биржевых фондов (ETF). Диверсифицируйте свой портфель за счет активов, которые отслеживают облигации, товары и индексы, без высоких затрат на владение базовыми активами.",
"-777850431": "Смотреть все >",
"-1384760133": "Цена бид",
"-1882694284": "Цена аск",
Expand Down Expand Up @@ -4568,4 +4569,4 @@
"-1165835520": "сотрудников",
"-651384976": "национальностей",
"-1033881248": "Смотреть вакансии"
}
}
Loading
Loading