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
176 changes: 123 additions & 53 deletions app/components/Views/ImportPrivateKey/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
<RCTSafeAreaView
style={
{
"backgroundColor": "#ffffff",
"flex": 1,
"marginTop": 48,
}
}
>
Expand Down Expand Up @@ -360,7 +360,6 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
showsVerticalScrollIndicator={false}
style={
{
"backgroundColor": "#4459ff1a",
"flex": 1,
}
}
Expand All @@ -376,64 +375,136 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
}
testID="import-account-screen"
>
<TouchableOpacity
accessible={true}
activeOpacity={1}
disabled={false}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
<View
style={
{
"alignItems": "center",
"alignSelf": "flex-end",
"borderRadius": 8,
"height": 32,
"justifyContent": "center",
"marginRight": 16,
"marginTop": 40,
"opacity": 1,
"width": 32,
}
[
{
"alignItems": "center",
"flexDirection": "row",
"gap": 16,
"height": 56,
"paddingLeft": 8,
"paddingRight": 8,
},
false,
undefined,
]
}
testID="close-button-on-account-screen"
testID="header"
>
<SvgMock
color="#121314"
fill="currentColor"
height={24}
name="Close"
<View>
<View
onLayout={[Function]}
>
<View
style={
[
{
"transform": [
{
"scale": 1,
},
],
},
{
"alignItems": "center",
"justifyContent": "center",
},
]
}
>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
[
{
"alignItems": "center",
"backgroundColor": "transparent",
"borderRadius": 2,
"height": 32,
"justifyContent": "center",
"opacity": 1,
"width": 32,
},
undefined,
]
}
testID="close-button-on-account-screen"
>
<SvgMock
fill="currentColor"
name="ArrowLeft"
style={
[
{
"color": "#121314",
"height": 20,
"width": 20,
},
undefined,
]
}
/>
</View>
</View>
</View>
</View>
<View
style={
{
"height": 24,
"width": 24,
}
[
{
"alignItems": "center",
"display": "flex",
"flexBasis": "0%",
"flexGrow": 1,
"flexShrink": 1,
},
undefined,
]
}
width={24}
/>
</TouchableOpacity>
<View>
<View
onLayout={[Function]}
/>
</View>
</View>
<View
style={
{
"padding": 24,
"paddingTop": 0,
"paddingHorizontal": 16,
"width": "100%",
}
}
>
<SvgMock
color="#121314"
fill="currentColor"
height={72}
name="Download"
style={
{
"height": 72,
"width": 72,
}
}
width={72}
/>
<View
style={
{
Expand All @@ -442,8 +513,7 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
"flexDirection": "column",
"justifyContent": "flex-start",
"marginTop": 16,
"paddingLeft": 12,
"rowGap": 24,
"rowGap": 8,
"width": "90%",
}
}
Expand All @@ -468,7 +538,7 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
accessibilityRole="text"
style={
{
"color": "#121314",
"color": "#686e7d",
"fontFamily": "Geist-Regular",
"fontSize": 14,
"letterSpacing": 0,
Expand All @@ -483,7 +553,7 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
onPress={[Function]}
style={
{
"color": "#121314",
"color": "#686e7d",
"fontFamily": "Geist-Regular",
"fontSize": 14,
"letterSpacing": 0,
Expand Down Expand Up @@ -549,15 +619,15 @@ exports[`ImportPrivateKey render matches snapshot 1`] = `
style={
[
{
"backgroundColor": "#ffffff",
"backgroundColor": "#f3f5f9",
"borderColor": "#b7bbc866",
"borderRadius": 6,
"borderWidth": 0.5,
"color": "#b7bbc8",
"fontFamily": "Geist-Regular",
"fontSize": 14,
"height": 120,
"marginVertical": 16,
"marginVertical": 8,
"paddingHorizontal": 16,
"paddingVertical": 12,
},
Expand Down
32 changes: 9 additions & 23 deletions app/components/Views/ImportPrivateKey/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ import { QRTabSwitcherScreens } from '../QRTabSwitcher';
import Routes from '../../../constants/navigation/Routes';
import { useAccountsWithNetworkActivitySync } from '../../hooks/useAccountsWithNetworkActivitySync';
import { Authentication } from '../../../core';
import Icon, {
IconName,
IconSize,
IconColor,
} from '../../../component-library/components/Icons/Icon';
import Text, {
TextVariant,
TextColor,
Expand All @@ -33,11 +28,9 @@ import Button, {
ButtonSize,
ButtonWidthTypes,
} from '../../../component-library/components/Buttons/Button';
import ButtonIcon, {
ButtonIconSizes,
} from '../../../component-library/components/Buttons/ButtonIcon';
import { selectSeedlessOnboardingAuthConnection } from '../../../selectors/seedlessOnboardingController';
import { AuthConnection } from '@metamask/seedless-onboarding-controller';
import HeaderCenter from '../../../component-library/components-temp/HeaderCenter';

/**
* View that's displayed the first time a user receives funds
Expand Down Expand Up @@ -168,33 +161,26 @@ const ImportPrivateKey = () => {
style={styles.content}
testID={ImportAccountFromPrivateKeyIDs.CONTAINER}
>
<ButtonIcon
onPress={dismiss}
iconName={IconName.Close}
size={ButtonIconSizes.Lg}
iconColor={IconColor.Default}
style={styles.navbarRightButton}
testID={ImportAccountFromPrivateKeyIDs.CLOSE_BUTTON}
<HeaderCenter
onBack={dismiss}
backButtonProps={{
testID: ImportAccountFromPrivateKeyIDs.CLOSE_BUTTON,
}}
/>
<View style={styles.top}>
<Icon
name={IconName.Download}
size={IconSize.XXL}
color={IconColor.Default}
/>
<View style={styles.textContainer}>
<Text style={styles.title}>
{strings('import_private_key.title')}
</Text>
<Text variant={TextVariant.BodySM} color={TextColor.Default}>
<Text variant={TextVariant.BodySM} color={TextColor.Alternative}>
{isSRP
? strings('import_private_key.description_srp')
: strings('import_private_key.description_one')}
</Text>
{isSRP ? (
<Text
variant={TextVariant.BodySM}
color={TextColor.Default}
color={TextColor.Alternative}
onPress={learnMore}
>
{strings('import_private_key.learn_more_srp')}{' '}
Expand All @@ -205,7 +191,7 @@ const ImportPrivateKey = () => {
) : (
<Text
variant={TextVariant.BodySM}
color={TextColor.Default}
color={TextColor.Alternative}
onPress={learnMore}
>
<Text variant={TextVariant.BodySM} color={TextColor.Primary}>
Expand Down
26 changes: 8 additions & 18 deletions app/components/Views/ImportPrivateKey/styles.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
/* eslint-disable import/prefer-default-export */
import { Platform, StyleSheet } from 'react-native';
import { StyleSheet, Platform } from 'react-native';
import { fontStyles } from '../../../styles/common';
import Device from '../../../util/device';
import { Colors } from '../../../util/theme/models';

// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const createStyles = (colors: any) =>
const createStyles = (colors: Colors) =>
StyleSheet.create({
mainWrapper: {
flex: 1,
backgroundColor: colors.background.default,
marginTop: 48,
},
topOverlay: {
flex: 1,
backgroundColor: colors.primary.muted,
},
wrapper: {
flexGrow: 1,
Expand Down Expand Up @@ -47,8 +44,7 @@ const createStyles = (colors: any) =>
backgroundColor: colors.background.default,
},
top: {
paddingTop: 0,
padding: 24,
paddingHorizontal: 16,
width: '100%',
},
bottom: {
Expand All @@ -58,7 +54,7 @@ const createStyles = (colors: any) =>
backgroundColor: colors.background.default,
},
input: {
backgroundColor: colors.background.default,
backgroundColor: colors.background.section,
fontSize: 14,
borderRadius: 6,
height: 120,
Expand All @@ -68,22 +64,16 @@ const createStyles = (colors: any) =>
color: colors.text.muted,
paddingHorizontal: 16,
paddingVertical: 12,
marginVertical: 16,
},
navbarRightButton: {
alignSelf: 'flex-end',
marginRight: 16,
marginTop: Device.isIphoneX() ? 40 : 24,
marginVertical: 8,
},
textContainer: {
width: '90%',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
justifyContent: 'flex-start',
rowGap: 24,
rowGap: 8,
marginTop: 16,
paddingLeft: 12,
},
});

Expand Down
Loading