-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from shayan-deriv/shayan/feq-2226/implement-he…
…ader-component Shayan/feq 2226/implement header component
- Loading branch information
Showing
8 changed files
with
681 additions
and
15,615 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { api } from '@/hooks'; | ||
import { CurrencyUsdIcon } from '@deriv/quill-icons'; | ||
import { AccountSwitcher as UIAccountSwitcher } from '@deriv-com/ui'; | ||
import { FormatUtils } from '@deriv-com/utils'; | ||
|
||
export const AccountSwitcher = () => { | ||
const { data } = api.account.useActiveAccount(); | ||
const activeAccount = { | ||
balance: FormatUtils.formatMoney(data?.balance ?? 0), | ||
currency: data?.currency || 'USD', | ||
currencyLabel: data?.currency || 'US Dollar', | ||
icon: <CurrencyUsdIcon iconSize='sm' />, | ||
isActive: true, | ||
isVirtual: Boolean(data?.is_virtual), | ||
loginid: data?.loginid || '', | ||
}; | ||
return data && <UIAccountSwitcher activeAccount={activeAccount} isDisabled />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { ReactNode } from 'react'; | ||
import { | ||
DerivProductDerivBotBrandLightLogoWordmarkHorizontalIcon as DerivBotLogo, | ||
DerivProductDerivTraderBrandLightLogoWordmarkHorizontalIcon as DerivTraderLogo, | ||
LabelPairedHouseBlankMdRegularIcon as TradershubLogo, | ||
LegacyCashierIcon as CashierLogo, | ||
LegacyReportsIcon as ReportsLogo, | ||
PartnersProductBinaryBotBrandLightLogoWordmarkHorizontalIcon as BinaryBotLogo, | ||
PartnersProductSmarttraderBrandLightLogoWordmarkIcon as SmarttraderLogo, | ||
} from '@deriv/quill-icons'; | ||
|
||
export type PlatformsConfig = { | ||
active: boolean; | ||
buttonIcon: ReactNode; | ||
description: string; | ||
href: string; | ||
icon: ReactNode; | ||
showInEU: boolean; | ||
}; | ||
|
||
export type MenuItemsConfig = { | ||
as: 'a' | 'button'; | ||
href: string; | ||
icon: ReactNode; | ||
label: string; | ||
}; | ||
|
||
export type TAccount = { | ||
balance: string; | ||
currency: string; | ||
icon: React.ReactNode; | ||
isActive: boolean; | ||
isEu: boolean; | ||
isVirtual: boolean; | ||
loginid: string; | ||
token: string; | ||
type: string; | ||
}; | ||
|
||
export const platformsConfig: PlatformsConfig[] = [ | ||
{ | ||
active: true, | ||
buttonIcon: <DerivTraderLogo height={25} width={114.97} />, | ||
description: 'A whole new trading experience on a powerful yet easy to use platform.', | ||
href: 'https://app.deriv.com', | ||
icon: <DerivTraderLogo height={32} width={148} />, | ||
showInEU: true, | ||
}, | ||
{ | ||
active: false, | ||
buttonIcon: <DerivBotLogo height={24} width={91} />, | ||
description: 'Automated trading at your fingertips. No coding needed.', | ||
href: 'https://app.deriv.com/bot', | ||
icon: <DerivBotLogo height={32} width={121} />, | ||
showInEU: false, | ||
}, | ||
{ | ||
active: false, | ||
buttonIcon: <SmarttraderLogo height={24} width={115} />, | ||
description: 'Trade the world’s markets with our popular user-friendly platform.', | ||
href: 'https://smarttrader.deriv.com/en/trading', | ||
icon: <SmarttraderLogo height={32} width={153} />, | ||
showInEU: false, | ||
}, | ||
{ | ||
active: false, | ||
buttonIcon: <BinaryBotLogo height={24} width={100} />, | ||
description: | ||
'Our classic “drag-and-drop” tool for creating trading bots, featuring pop-up trading charts, for advanced users.', | ||
href: 'https://bot.deriv.com', | ||
icon: <BinaryBotLogo height={32} width={133} />, | ||
showInEU: false, | ||
}, | ||
]; | ||
|
||
export const MenuItems: MenuItemsConfig[] = [ | ||
{ | ||
as: 'a', | ||
href: 'https://app.deriv.com/appstore/traders-hub', | ||
icon: <TradershubLogo />, | ||
label: "Trader's Hub", | ||
}, | ||
{ | ||
as: 'button', | ||
href: 'https://app.deriv.com/appstore/traders-hub', | ||
icon: <ReportsLogo iconSize='xs' />, | ||
label: 'Reports', | ||
}, | ||
{ | ||
as: 'button', | ||
href: 'https://app.deriv.com/appstore/traders-hub', | ||
icon: <CashierLogo iconSize='xs' />, | ||
label: 'Cashier', | ||
}, | ||
]; |
Oops, something went wrong.