Skip to content

Commit

Permalink
[Design Quality] Updated navbar title to remove green dot (#12773)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
- This PR updates the navbar title to remove the green dot
- Also updated the navbar title in Receive flow

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes: #12768 

## **Manual testing steps**

1. Go to wallet
2. Click on asset
3. Observe change in header
4. Go to receive
5. Observe change in header

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

https://github.com/user-attachments/assets/84d7e1c0-a9a9-4c26-9584-6d83cd1614bd

![Screenshot_1734556451](https://github.com/user-attachments/assets/0e294a97-5234-4b4b-bd8c-a1b250d0f9f3)

![Screenshot_1734557087](https://github.com/user-attachments/assets/fbe5baac-6859-413e-9a27-6cd9ea6c1be6)

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
brianacnguyen authored Dec 20, 2024
1 parent ec8804c commit 754f4f9
Show file tree
Hide file tree
Showing 23 changed files with 380 additions and 1,545 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`BottomSheetHeader should render snapshot correctly 1`] = `
<View
style={
{
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
"padding": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const styleSheet = (params: {
{
backgroundColor: theme.colors.background.default,
flexDirection: 'row',
alignItems: 'center',
} as ViewStyle,
style,
) as ViewStyle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`HeaderBase should render snapshot correctly 1`] = `
<View
style={
{
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
}
Expand Down
46 changes: 8 additions & 38 deletions app/components/UI/NavbarTitle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,19 @@ import { selectProviderConfig } from '../../../selectors/networkController';
import { withMetricsAwareness } from '../../../components/hooks/useMetrics';
import Text, {
TextVariant,
TextColor,
} from '../../../component-library/components/Texts/Text';

const createStyles = (colors) =>
StyleSheet.create({
wrapper: {
justifyContent: 'center',
alignItems: 'center',
flex: 1,
},
network: {
flexDirection: 'row',
alignItems: 'center',
},
networkName: {
fontSize: 11,
color: colors.text.alternative,
...fontStyles.normal,
},
networkIcon: {
width: 5,
height: 5,
borderRadius: 100,
marginRight: 5,
},
title: {
fontSize: scale(14),
...fontStyles.normal,
color: colors.text.default,
},
children: {
...fontStyles.normal,
color: colors.text.default,
fontWeight: 'bold',
},
otherNetworkIcon: {
backgroundColor: importedColors.transparent,
borderColor: colors.border.default,
borderWidth: 1,
},
});

/**
Expand Down Expand Up @@ -163,26 +137,22 @@ class NavbarTitle extends PureComponent {
activeOpacity={this.props.disableNetwork ? 1 : 0.2}
>
{title ? (
<Text numberOfLines={1} style={styles.title}>
<Text numberOfLines={1} variant={TextVariant.BodyMDBold}>
{realTitle}
</Text>
) : null}
{typeof children === 'string' ? (
<Text variant={TextVariant.HeadingMD} style={styles.children}>
{strings(children)}
</Text>
<Text variant={TextVariant.BodyMDBold}>{strings(children)}</Text>
) : (
children
)}
{showSelectedNetwork ? (
<View style={styles.network}>
<View
style={[
styles.networkIcon,
color ? { backgroundColor: color } : styles.otherNetworkIcon,
]}
/>
<Text numberOfLines={1} style={styles.networkName}>
<Text
numberOfLines={1}
variant={TextVariant.BodySM}
color={TextColor.Alternative}
>
{name}
</Text>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ exports[`NetworkDetails renders correctly 1`] = `
<View
style={
{
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
"padding": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exports[`NetworkVerificationInfo renders correctly 1`] = `
<View
style={
{
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
"padding": 16,
Expand Down
Loading

0 comments on commit 754f4f9

Please sign in to comment.