mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Hiding refresh list on non-Mainnet networks (#12210)
This commit is contained in:
parent
14f0d8245b
commit
77581256ca
@ -1632,6 +1632,9 @@
|
|||||||
"optionalCurrencySymbol": {
|
"optionalCurrencySymbol": {
|
||||||
"message": "Currency Symbol (optional)"
|
"message": "Currency Symbol (optional)"
|
||||||
},
|
},
|
||||||
|
"or": {
|
||||||
|
"message": "or"
|
||||||
|
},
|
||||||
"origin": {
|
"origin": {
|
||||||
"message": "Origin"
|
"message": "Origin"
|
||||||
},
|
},
|
||||||
|
@ -13,6 +13,7 @@ import {
|
|||||||
getCurrentAccountWithSendEtherInfo,
|
getCurrentAccountWithSendEtherInfo,
|
||||||
getShouldShowFiat,
|
getShouldShowFiat,
|
||||||
getNativeCurrencyImage,
|
getNativeCurrencyImage,
|
||||||
|
getIsMainnet,
|
||||||
} from '../../../selectors';
|
} from '../../../selectors';
|
||||||
import { getNativeCurrency } from '../../../ducks/metamask/metamask';
|
import { getNativeCurrency } from '../../../ducks/metamask/metamask';
|
||||||
import { useCurrencyDisplay } from '../../../hooks/useCurrencyDisplay';
|
import { useCurrencyDisplay } from '../../../hooks/useCurrencyDisplay';
|
||||||
@ -75,6 +76,7 @@ const AssetList = ({ onClickAsset }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const primaryTokenImage = useSelector(getNativeCurrencyImage);
|
const primaryTokenImage = useSelector(getNativeCurrencyImage);
|
||||||
|
const isMainnet = useSelector(getIsMainnet) || process.env.IN_TEST;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -106,6 +108,7 @@ const AssetList = ({ onClickAsset }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<ImportTokenLink
|
<ImportTokenLink
|
||||||
|
isMainnet={isMainnet}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push(IMPORT_TOKEN_ROUTE);
|
history.push(IMPORT_TOKEN_ROUTE);
|
||||||
addTokenEvent();
|
addTokenEvent();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { useMetricEvent } from '../../../hooks/useMetricEvent';
|
import { useMetricEvent } from '../../../hooks/useMetricEvent';
|
||||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||||
@ -8,7 +9,7 @@ import Box from '../../ui/box/box';
|
|||||||
import { TEXT_ALIGN } from '../../../helpers/constants/design-system';
|
import { TEXT_ALIGN } from '../../../helpers/constants/design-system';
|
||||||
import { detectNewTokens } from '../../../store/actions';
|
import { detectNewTokens } from '../../../store/actions';
|
||||||
|
|
||||||
export default function ImportTokenLink() {
|
export default function ImportTokenLink({ isMainnet }) {
|
||||||
const addTokenEvent = useMetricEvent({
|
const addTokenEvent = useMetricEvent({
|
||||||
eventOpts: {
|
eventOpts: {
|
||||||
category: 'Navigation',
|
category: 'Navigation',
|
||||||
@ -21,6 +22,8 @@ export default function ImportTokenLink() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box className="import-token-link" textAlign={TEXT_ALIGN.CENTER}>
|
<Box className="import-token-link" textAlign={TEXT_ALIGN.CENTER}>
|
||||||
|
{isMainnet && (
|
||||||
|
<>
|
||||||
<Button
|
<Button
|
||||||
className="import-token-link__link"
|
className="import-token-link__link"
|
||||||
type="link"
|
type="link"
|
||||||
@ -28,7 +31,9 @@ export default function ImportTokenLink() {
|
|||||||
>
|
>
|
||||||
{t('refreshList')}
|
{t('refreshList')}
|
||||||
</Button>
|
</Button>
|
||||||
{' or '}
|
{t('or')}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
className="import-token-link__link"
|
className="import-token-link__link"
|
||||||
type="link"
|
type="link"
|
||||||
@ -37,8 +42,15 @@ export default function ImportTokenLink() {
|
|||||||
addTokenEvent();
|
addTokenEvent();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('importTokens')}
|
{isMainnet
|
||||||
|
? t('importTokens')
|
||||||
|
: t('importTokens').charAt(0).toUpperCase() +
|
||||||
|
t('importTokens').slice(1)}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImportTokenLink.propTypes = {
|
||||||
|
isMainnet: PropTypes.bool,
|
||||||
|
};
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
@include H6;
|
@include H6;
|
||||||
|
|
||||||
display: inline;
|
display: inline;
|
||||||
padding: 0 0 16px;
|
padding: 0 5px 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user