Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singleaddress #164

Merged
merged 2 commits into from
Oct 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 29 additions & 20 deletions frontends/web/src/routes/account/receive/receive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export default class Receive extends Component {

render({
t,
coinCode,
code,
}, {
verifying,
Expand All @@ -129,30 +128,40 @@ export default class Receive extends Component {
paired,
}) {
let uriPrefix = 'bitcoin:';
if (coinCode === 'ltc' || coinCode === 'tltc') {
if (code.startsWith('ltc') || code.startsWith('tltc')) {
uriPrefix = 'litecoin:';
} else if (code.startsWith('eth') || code.startsWith('teth')) {
uriPrefix = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 'ethereum' prefix would be fine/desirable: ethereum/EIPs#67

}
const content = receiveAddresses ? (
<div>
<QRCode data={uriPrefix + receiveAddresses[activeIndex].address} />
<CopyableInput value={receiveAddresses[activeIndex].address} />
<div class={['flex flex-row flex-center flex-items-center', style.labels].join(' ')}>
<Button
transparent
disabled={verifying}
onClick={this.previous}>
<img src={ArrowLeft} class={style.arrowLeft} />
{t('button.previous')}
</Button>
<p class={style.label}>{`${t('receive.label')} (${activeIndex + 1}/${receiveAddresses.length})`}</p>
<Button
transparent
disabled={verifying}
onClick={this.next}
className={style.button}>
{t('button.next')}
<img src={ArrowRight} class={style.arrowRight} />
</Button>
{
receiveAddresses.length > 1 && (
<Button
transparent
disabled={verifying}
onClick={this.previous}>
<img src={ArrowLeft} class={style.arrowLeft} />
{t('button.previous')}
</Button>
)
}
<p class={style.label}>{t('receive.label')} { receiveAddresses.length > 1 ? `(${activeIndex + 1}/${receiveAddresses.length})` : ''}</p>
{
receiveAddresses.length > 1 && (
<Button
transparent
disabled={verifying}
onClick={this.next}
className={style.button}>
{t('button.next')}
<img src={ArrowRight} class={style.arrowRight} />
</Button>
)
}
</div>
{
code === 'ltc-p2wpkh-p2sh' && (
Expand Down Expand Up @@ -202,10 +211,10 @@ export default class Receive extends Component {
</div>
<Guide>
<Entry key="guide.receive.address" entry={t('guide.receive.address')} />
<Entry key="guide.receive.whyMany" entry={t('guide.receive.whyMany')} />
{ receiveAddresses && receiveAddresses.length > 1 && <Entry key="guide.receive.whyMany" entry={t('guide.receive.whyMany')} /> }
<Entry key="guide.receive.whyVerify" entry={t('guide.receive.whyVerify')} />
<Entry key="guide.receive.howVerify" entry={t('guide.receive.howVerify')} />
<Entry key="guide.receive.addressChange" entry={t('guide.receive.addressChange')} />
{ receiveAddresses && receiveAddresses.length > 1 && <Entry key="guide.receive.addressChange" entry={t('guide.receive.addressChange')} /> }
</Guide>
</div>
);
Expand Down