Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -20,7 +20,7 @@ function CreationStep ({ step, onClick, className }: Props): React.ReactElement<
<CurrentStep>{step}</CurrentStep>
<TotalSteps>/2</TotalSteps>
</div>
<ActionText text='Cancel' onClick={onClick} />
<ActionText text='Back' onClick={onClick} />
Comment thread
iksworbad marked this conversation as resolved.
Outdated
</div>
);
}
Expand Down
11 changes: 0 additions & 11 deletions packages/extension-ui/src/Popup/CreateAccount/Mnemonic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ const onCopy = (): void => {
document.execCommand('copy');
};

const onPrint = (seed: string) => (): void => {
const tab = window.open('about:blank', 'blank', 'width=800,height=600');
if (!tab) {
return;
}
tab.document.write(seed);
tab.print();
tab.close();
};

function Mnemonic ({ seed, onNextStep }: Props): React.ReactElement<Props> {
const [isMnemonicSaved, setIsMnemonicSaved] = useState(false);
return (
Expand All @@ -40,7 +30,6 @@ function Mnemonic ({ seed, onNextStep }: Props): React.ReactElement<Props> {
<MnemonicSeed
seed={seed}
onCopy={onCopy}
onPrint={onPrint(seed)}
/>
<VerticalSpace />
<Checkbox
Expand Down
25 changes: 14 additions & 11 deletions packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ interface Props {
className?: string;
}

function TransactionIndex ({ index, totalItems, onNextClick, onPreviousClick, className }: Props): React.ReactElement<Props> {
function TransactionIndex({ index, totalItems, onNextClick, onPreviousClick, className }: Props): React.ReactElement<Props> {
const previousClickActive = index !== 0;
const nextClickActive = index < totalItems - 1;

return (
<div className={className}>
<div>
<Transaction />
<CurrentIndex>{index + 1}</CurrentIndex>
<TotalItems>/{totalItems}</TotalItems>
</div>
<div>
<ArrowLeft onClick={(): unknown => previousClickActive && onPreviousClick()} isActive={previousClickActive} />
<ArrowRight onClick={(): unknown => nextClickActive && onNextClick()} isActive={nextClickActive} />
</div>
{totalItems !== 1 &&
Comment thread
iksworbad marked this conversation as resolved.
Outdated
<>
<div>
<Transaction />
<CurrentIndex>{index + 1}</CurrentIndex>
<TotalItems>/{totalItems}</TotalItems>
</div>
<div>
<ArrowLeft onClick={(): unknown => previousClickActive && onPreviousClick()} isActive={previousClickActive} />
<ArrowRight onClick={(): unknown => nextClickActive && onNextClick()} isActive={nextClickActive} />
</div>
</>}
</div>
);
}
Expand Down Expand Up @@ -61,7 +64,7 @@ interface ArrowProps {

const ArrowLeft = styled(Svg).attrs(() => ({
src: ArrowLeftImage
}))<ArrowProps>`
})) <ArrowProps>`
Comment thread
iksworbad marked this conversation as resolved.
Outdated
display: inline-block;
background: ${({ isActive, theme }): string => isActive ? theme.primaryColor : theme.iconNeutralColor};
cursor: ${({ isActive }): string => isActive ? 'pointer' : 'default'};
Expand Down
3 changes: 0 additions & 3 deletions packages/extension-ui/src/assets/print.svg

This file was deleted.

14 changes: 3 additions & 11 deletions packages/extension-ui/src/components/MnemonicSeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ import React, { MouseEventHandler } from 'react';
import TextAreaWithLabel from './TextAreaWithLabel';
import ActionText from '@polkadot/extension-ui/components/ActionText';
import copy from '../assets/copy.svg';
import print from '../assets/print.svg';

interface Props {
seed: string;
onCopy: MouseEventHandler<HTMLDivElement>;
onPrint: MouseEventHandler<HTMLDivElement>;
className?: string;
}

function MnemonicSeed ({ seed, onCopy, onPrint, className }: Props): React.ReactElement<Props> {
function MnemonicSeed ({ seed, onCopy, className }: Props): React.ReactElement<Props> {
return (
<div className={className}>
<MnemonicText value={seed} />
Expand All @@ -27,12 +25,6 @@ function MnemonicSeed ({ seed, onCopy, onPrint, className }: Props): React.React
text='Copy to clipboard'
onClick={onCopy}
/>
<ActionText
data-seed-action='print'
icon={print}
text='Print seed phrase'
onClick={onPrint}
/>
</ButtonsRow>
</div>
);
Expand All @@ -41,7 +33,7 @@ function MnemonicSeed ({ seed, onCopy, onPrint, className }: Props): React.React
const MnemonicText = styled(TextAreaWithLabel).attrs(() => ({
label: 'Generated 12-word mnemonic seed:',
isReadOnly: true
}))`
}))`
textarea {
font-size: ${({ theme }): string => theme.fontSize};
line-height: ${({ theme }): string => theme.lineHeight};
Expand All @@ -56,7 +48,7 @@ const MnemonicText = styled(TextAreaWithLabel).attrs(() => ({
const ButtonsRow = styled.div`
display: flex;
flex-direction: row;

${ActionText} {
margin-right: 32px;
}
Expand Down