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(3448): header update #11763

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fc3499c
feat(3447): Network Picker Component (#11715)
vinnyhoward Oct 11, 2024
add3e53
feat(3449): Simplified Address Copy Component (#11749)
vinnyhoward Oct 11, 2024
7569d35
update: picker account redesign
vinnyhoward Oct 11, 2024
a24bba4
update: move overflow flow
vinnyhoward Oct 16, 2024
ba929db
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 16, 2024
f0082c7
fix: tests relating to missing mock func
vinnyhoward Oct 16, 2024
8a0b55b
Merge branch 'main' into feat-header-update
vinnyhoward Oct 16, 2024
bf53cb4
Merge branch 'main' into feat-header-update
vinnyhoward Oct 16, 2024
971860c
fix: reverting overflow related files in favor of a separate pull req…
vinnyhoward Oct 16, 2024
fc63b0a
Merge branch 'feat-header-update' of github.com:MetaMask/metamask-mob…
vinnyhoward Oct 16, 2024
65df76f
Merge branch 'main' into feat-header-update
vinnyhoward Oct 17, 2024
e93926a
fix: updated ui according to feedback
vinnyhoward Oct 17, 2024
ed17de9
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 17, 2024
e9eb173
Merge branch 'feat-header-update' of github.com:MetaMask/metamask-mob…
vinnyhoward Oct 17, 2024
5c1b8a3
fix: e2e tests relating to refs for user account
vinnyhoward Oct 17, 2024
490b6b6
Merge branch 'main' into feat-header-update
vinnyhoward Oct 17, 2024
647c44e
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 17, 2024
6295f72
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 18, 2024
498de87
Merge branch 'main' into feat-header-update
vinnyhoward Oct 18, 2024
6f335f5
fix: remove label in picker
vinnyhoward Oct 18, 2024
31072ee
Merge branch 'feat-header-update' of github.com:MetaMask/metamask-mob…
vinnyhoward Oct 18, 2024
e98d68d
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 18, 2024
266c7c9
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 18, 2024
8b13549
Merge branch 'main' into feat-header-update
vinnyhoward Oct 21, 2024
354e2d8
fix: reverting a style for picker network
vinnyhoward Oct 22, 2024
452a6ab
Merge branch 'main' of github.com:MetaMask/metamask-mobile into feat-…
vinnyhoward Oct 22, 2024
93fa100
fix: added tests for new hook, updated tests ofr picker network
vinnyhoward Oct 22, 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { StyleSheet, ViewStyle } from 'react-native';

// External dependencies.
import { Theme } from '../../../../util/theme/models';
import { fontStyles } from '../../../../styles/common';

// Internal dependencies.
import { PickerAccountStyleSheetVars } from './PickerAccount.types';
Expand All @@ -24,34 +23,41 @@ const styleSheet = (params: {
const { colors } = theme;
const { style, cellAccountContainerStyle } = vars;
return StyleSheet.create({
base: Object.assign({} as ViewStyle, style) as ViewStyle,
base: {
...(style as ViewStyle),
flexDirection: 'row',
padding: 0,
borderWidth: 0,
},
accountAvatar: {
marginRight: 16,
marginRight: 8,
},
accountAddressLabel: {
color: colors.text.alternative,
textAlign: 'center',
},
cellAccount: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
...cellAccountContainerStyle,
},
accountNameLabel: {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
},
accountNameAvatar: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
},
accountNameLabelText: {
marginTop: 4,
marginHorizontal: 5,
paddingHorizontal: 5,
...fontStyles.bold,
color: colors.text.alternative,
borderWidth: 1,
borderRadius: 10,
borderColor: colors.border.default,
pickerAccountContainer: {
flexDirection: 'column',
justifyContent: 'center',
textAlign: 'center',
alignItems: 'center',
},
dropDownIcon: {
marginLeft: 8,
},
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import Avatar, { AvatarSize, AvatarVariant } from '../../Avatars/Avatar';
import Text, { TextVariant } from '../../Texts/Text';
import { formatAddress } from '../../../../util/address';
import { useStyles } from '../../../hooks';
import { strings } from '../../../../../locales/i18n';
import { IconSize } from '../../Icons/Icon';

// Internal dependencies.
import PickerBase from '../PickerBase';
import { PickerAccountProps } from './PickerAccount.types';
import styleSheet from './PickerAccount.styles';
import { WalletViewSelectorsIDs } from '../../../../../e2e/selectors/wallet/WalletView.selectors';
import { AccountListViewSelectorsIDs } from '../../../../../e2e/selectors/AccountListView.selectors';

const PickerAccount: React.ForwardRefRenderFunction<
TouchableOpacity,
Expand All @@ -27,7 +26,6 @@ const PickerAccount: React.ForwardRefRenderFunction<
accountAddress,
accountName,
accountAvatarType,
accountTypeLabel,
showAddress = true,
cellAccountContainerStyle = {},
...props
Expand All @@ -42,42 +40,46 @@ const PickerAccount: React.ForwardRefRenderFunction<

const renderCellAccount = () => (
<View style={styles.cellAccount}>
<Avatar
variant={AvatarVariant.Account}
type={accountAvatarType}
accountAddress={accountAddress}
size={AvatarSize.Md}
style={styles.accountAvatar}
/>
<View style={styles.accountNameLabel}>
<Text
variant={TextVariant.BodyMDMedium}
testID={WalletViewSelectorsIDs.ACCOUNT_NAME_LABEL_TEXT}
>
{accountName}
</Text>
{accountTypeLabel && (
<View style={styles.accountNameAvatar}>
<Avatar
variant={AvatarVariant.Account}
type={accountAvatarType}
accountAddress={accountAddress}
size={AvatarSize.Xs}
style={styles.accountAvatar}
/>
<Text
variant={TextVariant.BodySM}
style={styles.accountNameLabelText}
testID={AccountListViewSelectorsIDs.ACCOUNT_TYPE_LABEL}
variant={TextVariant.BodyMDMedium}
testID={WalletViewSelectorsIDs.ACCOUNT_NAME_LABEL_TEXT}
>
{strings(accountTypeLabel)}
</Text>
)}
{showAddress && (
<Text variant={TextVariant.BodyMD} style={styles.accountAddressLabel}>
{shortenedAddress}
{accountName}
</Text>
)}
</View>
</View>
</View>
);

return (
<PickerBase style={styles.base} {...props} ref={ref}>
{renderCellAccount()}
</PickerBase>
<View style={styles.pickerAccountContainer}>
<PickerBase
iconSize={IconSize.Xs}
style={styles.base}
dropdownIconStyle={styles.dropDownIcon}
{...props}
ref={ref}
>
{renderCellAccount()}
</PickerBase>
{showAddress && (
<Text
variant={TextVariant.BodySMMedium}
style={styles.accountAddressLabel}
>
{shortenedAddress}
</Text>
)}
</View>
);
};

Expand Down
Loading
Loading