Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b3eee9f
Add obfuscation toggle for private key input
ryanml Sep 4, 2023
8719919
Merge branch 'develop' into feature-20630
ryanml Sep 12, 2023
fe4dd9f
Merge branch 'develop' into feature-20630
plasmacorral Oct 4, 2023
8772e37
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 21, 2024
b428e73
feat: Remove unused import library.
dawnseeker8 Feb 21, 2024
0064d8e
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 21, 2024
93d72c1
feat: fix the styling issue.
dawnseeker8 Feb 21, 2024
4af779f
feat: Create a FormPasswordField components.
dawnseeker8 Feb 22, 2024
96b67d0
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 22, 2024
ca18d65
feat: add story files and unit tests file.
dawnseeker8 Feb 22, 2024
9ff339b
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 22, 2024
e61efc5
feat: revert the format to `dev` branch version, and add extract `for…
dawnseeker8 Feb 22, 2024
8c23baf
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 22, 2024
e5a63c3
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 23, 2024
27839a5
Merge branch 'develop' into feature-20630
dawnseeker8 Feb 26, 2024
50d3e81
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 4, 2024
688e867
feat: Remove all form-password-field components and add endAccessory …
dawnseeker8 Mar 4, 2024
959f8a1
feat: Commit changed file.
dawnseeker8 Mar 4, 2024
5bbd917
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 5, 2024
fd98630
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 5, 2024
9415863
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 6, 2024
e88ac90
chore: centering icon in show hide toggle component
georgewrmarshall Mar 6, 2024
b05123b
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 6, 2024
c28373f
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 7, 2024
bf47fd2
Merge branch 'develop' into feature-20630
dawnseeker8 Mar 7, 2024
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
12 changes: 12 additions & 0 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions ui/components/multichain/import-account/private-key.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import PropTypes from 'prop-types';
import React, { useState } from 'react';
import { useSelector } from 'react-redux';
import { TextFieldSize, TextFieldType } from '../../component-library';
import { FormTextField } from '../../component-library/form-text-field/deprecated';

import {
FormTextField,
TextFieldSize,
TextFieldType,
} from '../../component-library';

import { useI18nContext } from '../../../hooks/useI18nContext';

import ShowHideToggle from '../../ui/show-hide-toggle';
import BottomButtons from './bottom-buttons';

export default function PrivateKeyImportView({
Expand All @@ -13,6 +20,8 @@ export default function PrivateKeyImportView({
const t = useI18nContext();
const [privateKey, setPrivateKey] = useState('');

const [showPrivateKey, setShowPrivateKey] = useState(false);

const warning = useSelector((state) => state.appState.warning);

function handleKeyPress(event) {
Expand All @@ -32,16 +41,28 @@ export default function PrivateKeyImportView({
id="private-key-box"
size={TextFieldSize.Lg}
autoFocus
type={TextFieldType.Password}
helpText={warning}
error
helpText={warning}
label={t('pastePrivateKey')}
value={privateKey}
onChange={(event) => setPrivateKey(event.target.value)}
inputProps={{
onKeyPress: handleKeyPress,
}}
marginBottom={4}
type={showPrivateKey ? TextFieldType.Text : TextFieldType.Password}
textFieldProps={{
endAccessory: (
<ShowHideToggle
shown={showPrivateKey}
id="show-hide-private-key"
title={t('privateKeyShow')}
ariaLabelShown={t('privateKeyShown')}
ariaLabelHidden={t('privateKeyHidden')}
onChange={() => setShowPrivateKey(!showPrivateKey)}
/>
),
}}
/>

<BottomButtons
Expand Down
1 change: 1 addition & 0 deletions ui/components/ui/show-hide-toggle/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
appearance: none;

+ .show-hide-toggle__label {
display: flex;
cursor: pointer;
user-select: none;
}
Expand Down