Skip to content

Commit

Permalink
Merge branch 'main' into feat/update-stake-cta
Browse files Browse the repository at this point in the history
  • Loading branch information
amitabh94 authored Nov 12, 2024
2 parents 154ee95 + 89efabe commit c7993ae
Show file tree
Hide file tree
Showing 86 changed files with 5,931 additions and 3,518 deletions.
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,39 @@ 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: {
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: {
justifyContent: 'center',
textAlign: 'center',
alignItems: 'center',
},
dropDownIcon: {
marginLeft: 8,
},
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Avatar, { AvatarSize, AvatarVariant } from '../../Avatars/Avatar';
import Text, { TextVariant } from '../../Texts/Text';
import { formatAddress } from '../../../../util/address';
import { useStyles } from '../../../hooks';
import { IconSize } from '../../Icons/Icon';

// Internal dependencies.
import PickerBase from '../PickerBase';
Expand All @@ -25,7 +26,6 @@ const PickerAccount: React.ForwardRefRenderFunction<
accountAddress,
accountName,
accountAvatarType,
accountTypeLabel,
showAddress = true,
cellAccountContainerStyle = {},
...props
Expand All @@ -40,33 +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>
{showAddress && (
<Text variant={TextVariant.BodyMD} style={styles.accountAddressLabel}>
{shortenedAddress}
<View style={styles.accountNameAvatar}>
<Avatar
variant={AvatarVariant.Account}
type={accountAvatarType}
accountAddress={accountAddress}
size={AvatarSize.Xs}
style={styles.accountAvatar}
/>
<Text
variant={TextVariant.BodyMDMedium}
testID={WalletViewSelectorsIDs.ACCOUNT_NAME_LABEL_TEXT}
>
{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

0 comments on commit c7993ae

Please sign in to comment.