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

Feat: Nominate proxy #1647

Merged
merged 23 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { getMetadataPortalMetadataUrl, TROUBLESHOOTING_URL } from '../common/con

type Props = {
countdown: number;
onQrReset: () => void;
chainId: ChainId;
onQrReset: () => void;
};

export const QrGeneratorContainer = ({ countdown, onQrReset, chainId, children }: PropsWithChildren<Props>) => {
export const QrGeneratorContainer = ({ countdown, chainId, children, onQrReset }: PropsWithChildren<Props>) => {
const { t } = useI18n();

return (
Expand Down
26 changes: 19 additions & 7 deletions src/renderer/entities/transaction/ui/Scanning/ScanMultiframeQr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import { useEffect, useState } from 'react';
import { useI18n } from '@app/providers';
import { Transaction, useTransaction } from '@entities/transaction';
import { toAddress } from '@shared/lib/utils';
import { Button } from '@shared/ui';
import { Button, FootnoteText } from '@shared/ui';
import type { Account, BaseAccount, ChainId, ShardAccount } from '@shared/core';
import { SigningType, Wallet } from '@shared/core';
import { createSubstrateSignPayload, createMultipleSignPayload } from '../QrCode/QrGenerator/common/utils';
import { TRANSACTION_BULK } from '../QrCode/common/constants';
import { QrMultiframeGenerator } from '../QrCode/QrGenerator/QrMultiframeTxGenerator';
import { QrGeneratorContainer } from '../QrCode/QrGeneratorContainer/QrGeneratorContainer';
import { WalletIcon } from '../../../wallet';

type Props = {
api: ApiPromise;
Expand Down Expand Up @@ -103,16 +104,27 @@ export const ScanMultiframeQr = ({

return (
<div className="flex flex-col items-center w-full">
<div className="mt-10">
<QrGeneratorContainer countdown={countdown} chainId={chainId} onQrReset={setupTransactions}>
{bulkTxExist && encoder && <QrMultiframeGenerator payload={bulkTransactions} size={200} encoder={encoder} />}
</QrGeneratorContainer>
</div>
{accounts.length > 0 && (
<div className="flex items-center justify-center mb-1 h-8 w-full">
<div className="flex h-full justify-center items-center gap-x-0.5 ">
<FootnoteText className="text-text-secondary">{t('signing.signer')}</FootnoteText>

<div className="w-full flex gap-x-2 items-center px-2">
<WalletIcon className="shrink-0" type={signerWallet.type} size={16} />
<FootnoteText className="text-text-secondary w-max">{signerWallet.name}</FootnoteText>
</div>
</div>
</div>
)}

<QrGeneratorContainer countdown={countdown} chainId={chainId} onQrReset={setupTransactions}>
{bulkTxExist && encoder && <QrMultiframeGenerator payload={bulkTransactions} size={200} encoder={encoder} />}
</QrGeneratorContainer>

<div className="flex w-full justify-between mt-3">
<Button variant="text" onClick={onGoBack}>
{t('operation.goBackButton')}
</Button>

<Button disabled={!bulkTxExist || countdown === 0} onClick={() => onResult(unsignedTransactions, txPayloads)}>
{t('signing.continueButton')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export const ScanSingleframeQr = ({

return (
<div className="flex flex-col items-center w-full">
<div className="flex items-center justify-center mb-1 h-8 w-full">
{account && (
{account && (
<div className="flex items-center justify-center mb-1 h-8 w-full">
<div className="flex h-full justify-center items-center gap-x-0.5 ">
<FootnoteText className="text-text-secondary">{t('signing.signer')}</FootnoteText>

Expand All @@ -76,8 +76,8 @@ export const ScanSingleframeQr = ({
<FootnoteText className="text-text-secondary w-max">{signerWallet.name}</FootnoteText>
</div>
</div>
)}
</div>
</div>
)}

<QrGeneratorContainer countdown={countdown} chainId={chainId} onQrReset={setupTransaction}>
{txPayload && (
Expand Down
Empty file.

This file was deleted.

Loading
Loading