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

fix(431-2): active network icon has too much margin and adding optional prop #12405

Merged
merged 2 commits into from
Dec 2, 2024
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
21 changes: 16 additions & 5 deletions app/components/UI/NavbarTitle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const createStyles = (colors) =>
},
network: {
flexDirection: 'row',
alignItems: 'center',
},
networkName: {
fontSize: 11,
Expand All @@ -37,7 +38,6 @@ const createStyles = (colors) =>
height: 5,
borderRadius: 100,
marginRight: 5,
marginTop: Device.isIos() ? 4 : 5,
},
title: {
fontSize: scale(14),
Expand Down Expand Up @@ -90,6 +90,10 @@ class NavbarTitle extends PureComponent {
* Boolean that specifies if the network selected is displayed
*/
showSelectedNetwork: PropTypes.bool,
/**
* Name of the network to display
*/
networkName: PropTypes.string,
/**
* Content to display inside text element
*/
Expand Down Expand Up @@ -125,16 +129,24 @@ class NavbarTitle extends PureComponent {
};

render = () => {
const { providerConfig, title, translate, showSelectedNetwork, children } =
this.props;
const {
providerConfig,
title,
translate,
showSelectedNetwork,
children,
networkName,
} = this.props;
let name = null;
const color =
(Networks[providerConfig.type] && Networks[providerConfig.type].color) ||
null;
const colors = this.context.colors || mockTheme.colors;
const styles = createStyles(colors);

if (providerConfig.nickname) {
if (networkName) {
name = networkName;
} else if (providerConfig.nickname) {
name = providerConfig.nickname;
} else {
name =
Expand All @@ -143,7 +155,6 @@ class NavbarTitle extends PureComponent {
}

const realTitle = translate ? strings(title) : title;

return (
<TouchableOpacity
onPress={this.openNetworkList}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -192,7 +193,6 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -882,6 +882,7 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -893,7 +894,6 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -1583,6 +1583,7 @@ exports[`BuildQuote View Crypto Currency Data renders an error page when there i
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -1594,7 +1595,6 @@ exports[`BuildQuote View Crypto Currency Data renders an error page when there i
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -2255,6 +2255,7 @@ exports[`BuildQuote View Crypto Currency Data renders the loading page when cryp
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -2266,7 +2267,6 @@ exports[`BuildQuote View Crypto Currency Data renders the loading page when cryp
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -3203,6 +3203,7 @@ exports[`BuildQuote View Fiat Currency Data renders an error page when there is
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -3214,7 +3215,6 @@ exports[`BuildQuote View Fiat Currency Data renders an error page when there is
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -3875,6 +3875,7 @@ exports[`BuildQuote View Fiat Currency Data renders the loading page when fiats
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -3886,7 +3887,6 @@ exports[`BuildQuote View Fiat Currency Data renders the loading page when fiats
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -4823,6 +4823,7 @@ exports[`BuildQuote View Payment Method Data renders an error page when there is
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -4834,7 +4835,6 @@ exports[`BuildQuote View Payment Method Data renders an error page when there is
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -5495,6 +5495,7 @@ exports[`BuildQuote View Payment Method Data renders the loading page when payme
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -5506,7 +5507,6 @@ exports[`BuildQuote View Payment Method Data renders the loading page when payme
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -6443,6 +6443,7 @@ exports[`BuildQuote View Regions data renders an error page when there is a regi
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -6454,7 +6455,6 @@ exports[`BuildQuote View Regions data renders an error page when there is a regi
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -7115,6 +7115,7 @@ exports[`BuildQuote View Regions data renders the loading page when regions are
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -7126,7 +7127,6 @@ exports[`BuildQuote View Regions data renders the loading page when regions are
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -8063,6 +8063,7 @@ exports[`BuildQuote View renders correctly 1`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -8074,7 +8075,6 @@ exports[`BuildQuote View renders correctly 1`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -11118,6 +11118,7 @@ exports[`BuildQuote View renders correctly 2`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -11129,7 +11130,6 @@ exports[`BuildQuote View renders correctly 2`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -14153,6 +14153,7 @@ exports[`BuildQuote View renders correctly when sdkError is present 1`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -14164,7 +14165,6 @@ exports[`BuildQuote View renders correctly when sdkError is present 1`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -14825,6 +14825,7 @@ exports[`BuildQuote View renders correctly when sdkError is present 2`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -14836,7 +14837,6 @@ exports[`BuildQuote View renders correctly when sdkError is present 2`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ exports[`GetStarted renders correctly 1`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -169,7 +170,6 @@ exports[`GetStarted renders correctly 1`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -831,6 +831,7 @@ exports[`GetStarted renders correctly 2`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -842,7 +843,6 @@ exports[`GetStarted renders correctly 2`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -1504,6 +1504,7 @@ exports[`GetStarted renders correctly when getStarted is true 1`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -1515,7 +1516,6 @@ exports[`GetStarted renders correctly when getStarted is true 1`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down Expand Up @@ -1947,6 +1947,7 @@ exports[`GetStarted renders correctly when sdkError is present 1`] = `
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
Expand All @@ -1958,7 +1959,6 @@ exports[`GetStarted renders correctly when sdkError is present 1`] = `
"borderRadius": 100,
"height": 5,
"marginRight": 5,
"marginTop": 4,
"width": 5,
},
{
Expand Down
Loading
Loading