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

search: l2 clean up #5333

Merged
merged 2 commits into from
Jan 26, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/components/expanded-state/asset/ChartExpandedState.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ export default function ChartExpandedState({ asset }) {
return hasBalance
? { ...asset }
: genericAsset
? ethereumUtils.formatGenericAsset(genericAsset, nativeCurrency)
? asset?.networks
? {
...ethereumUtils.formatGenericAsset(genericAsset, nativeCurrency),
type: asset.type,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

networks only exists if coming from search, this overrides types to allow for l2 only assets for this screen

colors: asset?.colors,
}
: ethereumUtils.formatGenericAsset(genericAsset, nativeCurrency)
: { ...asset };
}, [asset, genericAsset, hasBalance, nativeCurrency]);

Expand Down Expand Up @@ -415,7 +421,7 @@ export default function ChartExpandedState({ asset }) {
<BuyActionButton color={color} />
</SheetActionButtonRow>
) : null}
{isL2 && (
{!networks && isL2 && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just making sure we done show 2 network disclaimers if coming from search

<L2Disclaimer
assetType={assetWithPrice.type}
colors={colors}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import {
import { useChartData } from '@/react-native-animated-charts/src';
import ChartTypes from '@/helpers/chartTypes';
import { convertAmountToNativeDisplay } from '@/helpers/utilities';
import { useAccountSettings, useBooleanState, useDimensions } from '@/hooks';
import { useAccountSettings, useBooleanState } from '@/hooks';
import styled from '@/styled-thing';
import { padding } from '@/styles';
import { useDispatch, useSelector } from 'react-redux';

const noPriceData = lang.t('expanded_state.chart.no_price_data');

Expand Down
2 changes: 1 addition & 1 deletion src/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
"read_more_button": "Read more",
"available_networks": "Available on %{availableNetworks} networks",
"available_network": "Available on the %{availableNetwork} network",
"available_networkv2": "Also available on %{availableNetwork}",
"available_networkv2": "Only available on %{availableNetwork}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy change to support if the asset is only on 1 network, which previously was not possible

"l2_disclaimer": "This %{symbol} is on the %{network} network",
"l2_disclaimer_send": "Sending on the %{network} network",
"l2_disclaimer_dapp": "This app on the %{network} network",
Expand Down