forked from binary-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #123 from jim-deriv/Jim/85355/transfer-top-up
Jim/85355/transfer top up
- Loading branch information
Showing
12 changed files
with
134 additions
and
55 deletions.
There are no files selected for viewing
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
21 changes: 16 additions & 5 deletions
21
packages/appstore/src/components/containers/trading-app-card.scss
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
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
4 changes: 4 additions & 0 deletions
4
packages/appstore/src/components/multi-action-button-group/index.ts
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,4 @@ | ||
import MultiActionButtonGroup from './multi-action-button-group'; | ||
import './multi-action-button-group.scss'; | ||
|
||
export default MultiActionButtonGroup; |
2 changes: 1 addition & 1 deletion
2
...on-group/transfer-trade-button-group.scss → ...tton-group/multi-action-button-group.scss
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
34 changes: 34 additions & 0 deletions
34
packages/appstore/src/components/multi-action-button-group/multi-action-button-group.tsx
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,34 @@ | ||
import { Button } from '@deriv/components'; | ||
import { localize } from '@deriv/translations'; | ||
import { Actions } from 'Components/containers/trading-app-card-actions'; | ||
import TradeButton from 'Components/trade-button'; | ||
import React from 'react'; | ||
|
||
/** | ||
* Handles Transfer, Trade and top up. It uses the name attribute of the <button /> element to distinguish between transfer and top up | ||
* @param { string } link_to // contains the URL for the trade button | ||
* @param { onAction } // a callback function that handles the current action | ||
* @param { boolean } // indicates whether the current account type is real or demo | ||
* @returns {JSX.Element} | ||
* */ | ||
const MultiActionButtonGroup = ({ | ||
link_to, | ||
onAction, | ||
is_buttons_disabled, | ||
is_real, | ||
}: Pick<Actions, 'link_to' | 'onAction' | 'is_buttons_disabled' | 'is_real'>) => { | ||
return ( | ||
<div className='multi-action-button-group'> | ||
<Button | ||
secondary | ||
name={`${is_real ? 'transfer-btn' : 'topup-btn'}`} | ||
onClick={onAction} | ||
is_disabled={is_buttons_disabled} | ||
> | ||
{is_real ? localize('Transfer') : localize('Top up')} | ||
</Button> | ||
<TradeButton link_to={link_to} onAction={onAction} is_buttons_disabled={is_buttons_disabled} /> | ||
</div> | ||
); | ||
}; | ||
export default MultiActionButtonGroup; |
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
4 changes: 0 additions & 4 deletions
4
packages/appstore/src/components/transfer-trade-button-group/index.ts
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
packages/appstore/src/components/transfer-trade-button-group/transfer-trade-button-group.tsx
This file was deleted.
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