Skip to content

Commit

Permalink
add more derived acounts component (#6341)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdiyeh-deriv committed Sep 5, 2022
1 parent e5de8ae commit 889d19e
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 15 deletions.
12 changes: 12 additions & 0 deletions packages/appstore/src/components/add-derived/add-derived.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.add-derived {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
cursor: pointer;
& > p {
color: $color-black-7;
margin-left: 0.4rem;
}
}
23 changes: 23 additions & 0 deletions packages/appstore/src/components/add-derived/add-derived.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { HTMLAttributes } from 'react';
import { Text } from '@deriv/ui';
import classNames from 'classnames';
import { Icon } from '@deriv/components';

export interface TAddDerivedProps extends HTMLAttributes<HTMLDivElement> {
onClickHandler: () => void;
class_names?: string;
title: string;
}

const AddDerived = ({ title, onClickHandler, class_names }: TAddDerivedProps) => {
return (
<div className={classNames('add-derived', class_names)} onClick={onClickHandler}>
<Icon icon='icAppstoreAddRounded' width='24' height='24' />
<Text type='paragraph-2' bold>
{title}
</Text>
</div>
);
};

export default AddDerived;
4 changes: 4 additions & 0 deletions packages/appstore/src/components/add-derived/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import AddDerived from './add-derived';
import './add-derived.scss';

export default AddDerived;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import type { Meta, Story } from '@storybook/react';
import AddDerived from '../index';

type AddDerivedProps = Parameters<typeof AddDerived>[0];

export default {
title: 'AddDerived',
argTypes: {
title: {
type: 'string',
defaultValue: 'More Derived accounts',
},
class_names: {
type: 'string',
defaultValue: '',
},
},
} as Meta<AddDerivedProps>;

const Template: Story<AddDerivedProps> = args => <AddDerived {...args} />;

export const AppLauncherTemplate = Template.bind({});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/components/src/components/icon/icons.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// auto-generated file. DO NOT MODIFY.

import './appstore/ic-appstore-add-rounded.svg';
import './appstore/ic-appstore-app-card-default-background-small.svg';
import './appstore/ic-appstore-app-card-default-background.svg';
import './appstore/ic-appstore-cfds-trade-type.svg';
Expand Down
32 changes: 17 additions & 15 deletions packages/components/stories/icon/icons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// auto-generated file. DO NOT MODIFY.

export const icons = {
appstore: [
export const icons =
{
'appstore': [
'IcAppstoreAddRounded',
'IcAppstoreAppCardDefaultBackgroundSmall',
'IcAppstoreAppCardDefaultBackground',
'IcAppstoreCfdsTradeType',
Expand Down Expand Up @@ -43,7 +45,7 @@ export const icons = {
'IcAppstoreWalletUsdtLight',
'IcAppstoreWarning',
],
brand: [
'brand': [
'IcBrandBinarybot',
'IcBrandDbot',
'IcBrandDerivApps',
Expand All @@ -56,7 +58,7 @@ export const icons = {
'IcBrandDxtrade',
'IcBrandSmarttrader',
],
cashier: [
'cashier': [
'IcCashierAdd',
'IcCashierAirTmDark',
'IcCashierAirTmLight',
Expand Down Expand Up @@ -184,7 +186,7 @@ export const icons = {
'IcCashierXanpoolSmallLight',
'IcCashier',
],
common: [
'common': [
'IcAccountError',
'IcAccountLimits',
'IcAccountMissingDetailsDashboard',
Expand Down Expand Up @@ -454,7 +456,7 @@ export const icons = {
'IcZoomIn',
'IcZoomOut',
],
contract: [
'contract': [
'IcContractBarrier',
'IcContractBuyPrice',
'IcContractCommission',
Expand All @@ -470,7 +472,7 @@ export const icons = {
'IcContractStartTime',
'IcContractTarget',
],
currency: [
'currency': [
'IcCurrencyAud',
'IcCurrencyBch',
'IcCurrencyBtc',
Expand All @@ -493,7 +495,7 @@ export const icons = {
'IcCurrencyUst',
'IcCurrencyVirtual',
],
dxtrade: [
'dxtrade': [
'IcDxtradeDeviceDesktopLight',
'IcDxtradeDeviceDesktop',
'IcDxtradeDeviceLaptopLight',
Expand All @@ -508,7 +510,7 @@ export const icons = {
'IcDxtradeSyntheticPlatform',
'IcDxtradeSynthetic',
],
flag: [
'flag': [
'IcFlagDe',
'IcFlagEn',
'IcFlagEs',
Expand All @@ -524,7 +526,7 @@ export const icons = {
'IcFlagZhCn',
'IcFlagZhTw',
],
mt5: [
'mt5': [
'IcMt5CfdPlatform',
'IcMt5Cfds',
'IcMt5DeviceDesktop',
Expand All @@ -551,7 +553,7 @@ export const icons = {
'IcMt5Synthetic',
'IcMt5TradeTypes',
],
option: [
'option': [
'IcOptionCallPutReset',
'IcOptionCallPutSpread',
'IcOptionCloseToLow',
Expand All @@ -569,7 +571,7 @@ export const icons = {
'IcOptionTouchNotouch',
'IcOptionUpDownAsian',
],
stock: [
'stock': [
'IcStockAdidasSalomon',
'IcStockAlibaba',
'IcStockAlphabet',
Expand Down Expand Up @@ -619,7 +621,7 @@ export const icons = {
'IcStockWaltDisney',
'IcStockZoom',
],
tradetype: [
'tradetype': [
'IcTradetypeAsiand',
'IcTradetypeAsianu',
'IcTradetypeCallBarrier',
Expand Down Expand Up @@ -654,7 +656,7 @@ export const icons = {
'IcTradetypeTicklow',
'IcTradetypeUpordown',
],
underlying: [
'underlying': [
'IcUnderlying1HZ100V',
'IcUnderlying1HZ10V',
'IcUnderlying1HZ200V',
Expand Down Expand Up @@ -811,7 +813,7 @@ export const icons = {
'IcUnderlyingWLDUSD',
'IcUnderlyingWLDXAU',
],
wallet: [
'wallet': [
'IcWalletClearFunds',
'IcWalletCreditDebitDark',
'IcWalletCreditDebitLight',
Expand Down

0 comments on commit 889d19e

Please sign in to comment.