Skip to content
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 @@ -70,7 +70,7 @@ describe('Create Account', () => {
it('clicking on Next activates phase 2', () => {
check(wrapper.find('input[type="checkbox"]'));
wrapper.find('button').simulate('click');
expect(wrapper.find(CreationStep).text()).toBe('Create an account:2/2Cancel');
expect(wrapper.find(CreationStep).text()).toBe('Create an account:2/2Back');
});
});

Expand Down
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={step === 1 ? 'Cancel' : 'Back'} onClick={onClick} />
</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
4 changes: 2 additions & 2 deletions packages/extension-ui/src/Popup/Signing/Request.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function Request ({ account: { isExternal }, request, signId, url
{isFirst && !isExternal && <Unlock onSign={_onSign} />}
<ActionBar>
<div />
<Link isDanger onClick={_onCancel}>Cancel</Link>
<Link isDanger onClick={_onCancel}>Reject</Link>
</ActionBar>
</Address>
);
Expand All @@ -114,7 +114,7 @@ const CancelButton = styled(ActionBar)`
margin-top: 4px;
margin-bottom: 4px;
text-decoration: underline;

a {
margin: auto;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-ui/src/Popup/Signing/Signing.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('Signing requests', () => {
emitter.emit('request', [signRequests[0]]);
});
wrapper.update();
expect(wrapper.find(TransactionIndex).text()).toBe('Transaction:1/1');
expect(wrapper.find(TransactionIndex).text()).toBe('');
expect(wrapper.find(Request).prop('signId')).toBe(signRequests[0].id);
});
});
Expand Down
21 changes: 12 additions & 9 deletions packages/extension-ui/src/Popup/Signing/TransactionIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ function TransactionIndex ({ index, totalItems, onNextClick, onPreviousClick, cl

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 && (
<>
<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
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