-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MC 0.5][FEATURE] Account actions on wallet view (#6093)
* account actions and account action * Actions wallet bottom sheet added * comments addressed, integration done * remove unused imports * add appium e2e test * snapshot * update snapshot * Update Appium Test scripts (#6292) --------- Co-authored-by: SamuelSalas <samuel.salas.reyes@gmail.com>
- Loading branch information
1 parent
9fe2df2
commit 320a4fb
Showing
31 changed files
with
646 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/components/Views/AccountAction/AccountAction.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Third party dependencies. | ||
import { StyleSheet, ViewStyle } from 'react-native'; | ||
|
||
// External dependencies. | ||
import { Theme } from '../../../util/theme/models'; | ||
|
||
// Internal dependencies. | ||
import { TouchableOpacityStyleSheetVars } from './AccountAction.types'; | ||
|
||
/** | ||
* Style sheet function for AccountAction component. | ||
* | ||
* @param params Style sheet params. | ||
* @param params.theme App theme from ThemeContext. | ||
* @param params.vars Inputs that the style sheet depends on. | ||
* @returns StyleSheet object. | ||
*/ | ||
const styleSheet = (params: { | ||
theme: Theme; | ||
vars: TouchableOpacityStyleSheetVars; | ||
}) => { | ||
const { theme, vars } = params; | ||
const { style } = vars; | ||
const { colors } = theme; | ||
|
||
return StyleSheet.create({ | ||
base: Object.assign( | ||
{ | ||
width: '100%', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
paddingVertical: 16, | ||
}, | ||
style, | ||
) as ViewStyle, | ||
descriptionLabel: { | ||
color: colors.text.alternative, | ||
}, | ||
icon: { | ||
marginHorizontal: 16, | ||
}, | ||
}); | ||
}; | ||
|
||
export default styleSheet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Third party dependencies. | ||
import React from 'react'; | ||
import { TouchableOpacity } from 'react-native'; | ||
// External dependencies. | ||
import Text, { | ||
TextVariant, | ||
} from '../../../component-library/components/Texts/Text'; | ||
import { useStyles } from '../../../component-library/hooks'; | ||
// Internal dependencies. | ||
import { WalletActionProps } from './AccountAction.types'; | ||
import styleSheet from './AccountAction.styles'; | ||
import Icon, { | ||
IconSize, | ||
} from '../../../component-library/components/Icons/Icon'; | ||
|
||
const AccountAction = ({ | ||
actionTitle, | ||
iconName, | ||
iconSize = IconSize.Md, | ||
style, | ||
...props | ||
}: WalletActionProps) => { | ||
const { styles } = useStyles(styleSheet, { style }); | ||
return ( | ||
<TouchableOpacity style={styles.base} {...props}> | ||
<Icon style={styles.icon} size={iconSize} name={iconName} /> | ||
|
||
<Text variant={TextVariant.BodyLGMedium}>{actionTitle}</Text> | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
export default AccountAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TouchableOpacityProps } from 'react-native'; | ||
import { | ||
IconName, | ||
IconSize, | ||
} from '../../../component-library/components/Icons/Icon'; | ||
|
||
export interface WalletActionProps extends TouchableOpacityProps { | ||
actionTitle: string; | ||
iconName: IconName; | ||
iconSize?: IconSize; | ||
} | ||
|
||
/** | ||
* Style sheet input parameters. | ||
*/ | ||
export type TouchableOpacityStyleSheetVars = Pick< | ||
TouchableOpacityProps, | ||
'style' | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './AccountAction'; |
5 changes: 5 additions & 0 deletions
5
app/components/Views/AccountActions/AccountActions.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Test IDs | ||
export const EDIT_ACCOUNT = 'edit-account-action'; | ||
export const VIEW_ETHERSCAN = 'view-etherscan-action'; | ||
export const SHARE_ADDRESS = 'share-address-action'; | ||
export const SHOW_PRIVATE_KEY = 'show-private-key-action'; |
18 changes: 18 additions & 0 deletions
18
app/components/Views/AccountActions/AccountActions.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Third party dependencies. | ||
import { StyleSheet } from 'react-native'; | ||
|
||
/** | ||
* Style sheet function for AccountActions component. | ||
* | ||
* @returns StyleSheet object. | ||
*/ | ||
const styleSheet = () => | ||
StyleSheet.create({ | ||
actionsContainer: { | ||
alignItems: 'flex-start', | ||
justifyContent: 'center', | ||
paddingVertical: 16, | ||
}, | ||
}); | ||
|
||
export default styleSheet; |
Oops, something went wrong.