This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
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 #26 from oxygenpay/develop
merge: develop
- Loading branch information
Showing
9 changed files
with
132 additions
and
85 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions
42
ui-dashboard/src/components/payment-method-item/payment-method-item.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,42 @@ | ||
import * as React from "react"; | ||
import bevis from "src/utils/bevis"; | ||
import {Space, Tag} from "antd"; | ||
import SpinWithMask from "src/components/spin-with-mask/spin-with-mask"; | ||
import {BlockchainTicker, PaymentMethod} from "src/types/index"; | ||
import Icon from "src/components/icon/icon"; | ||
|
||
const b = bevis("payment-methods-select"); | ||
|
||
interface Props { | ||
title: string; | ||
items: PaymentMethod[]; | ||
onChange: (ticker: BlockchainTicker) => void; | ||
isLoading: boolean; | ||
} | ||
|
||
const PaymentMethodsItem: React.FC<Props> = (props: Props) => { | ||
return ( | ||
<Space size={[0, 8]} wrap className={b()}> | ||
{props.items.map((item) => ( | ||
<Tag | ||
key={item.name} | ||
icon={<Icon name={item.name.toLowerCase()} dir="crypto" className={b("icon")} />} | ||
color={item.enabled ? "#1777ff" : "#bebebe"} | ||
className={b("option")} | ||
> | ||
<span className={b("option-text")}>{item.name}</span> | ||
<div | ||
className={b("overlay")} | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
props.onChange(item.ticker); | ||
}} | ||
/> | ||
<SpinWithMask isLoading={props.isLoading} /> | ||
</Tag> | ||
))} | ||
</Space> | ||
); | ||
}; | ||
|
||
export default PaymentMethodsItem; |
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
Oops, something went wrong.