Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
import RequestLSK from './requestLsk'; | ||
import { tokenKeys } from '../../constants/tokens'; | ||
import RequestBtc from './requestBtc'; | ||
import RequestLsk from './requestLsk'; | ||
|
||
const TagNameMap = { | ||
LSK: RequestLsk, | ||
BTC: RequestBtc, | ||
}; | ||
|
||
const Request = ({ | ||
address, t, | ||
}) => ( | ||
<RequestLSK address={address} t={t} /> | ||
); | ||
address, t, token, | ||
}) => { | ||
const TagName = TagNameMap[token]; | ||
return <TagName address={address} t={t} />; | ||
}; | ||
|
||
Request.propTypes = { | ||
address: PropTypes.string.required, | ||
token: PropTypes.oneOf(tokenKeys).required, | ||
t: PropTypes.func, | ||
}; | ||
|
||
Request.defaultProps = { | ||
address: '', | ||
token: 'LSK', | ||
}; | ||
|
||
export default Request; |
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,24 @@ | ||
import React from 'react'; | ||
|
||
import RequestWrapper from './requestWrapper'; | ||
|
||
import styles from './requestV2.css'; | ||
|
||
const RequestBtc = ({ | ||
address, t, | ||
}) => ( | ||
<RequestWrapper copyLabel={t('Copy address')} copyValue={address} t={t}> | ||
<span className={`${styles.label}`}> | ||
{t('Copy the address or scan the QR code, to easily request BTC tokens from Lisk Hub or Lisk Mobile users.')} | ||
</span> | ||
<label className={`${styles.fieldGroup}`}> | ||
<span className={`${styles.fieldLabel}`}>{t('BTC Address')}</span> | ||
<span className={`${styles.amountField} address`}> | ||
{address} | ||
</span> | ||
</label> | ||
</RequestWrapper> | ||
|
||
); | ||
|
||
export default RequestBtc; |