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(ui-ux): hide send btn for evm domain #4153

Merged
merged 4 commits into from
Dec 4, 2023
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
52 changes: 26 additions & 26 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Define individuals that are responsible for code in a repository.
# More details are here: https://help.github.com/articles/about-codeowners/

/.github/ @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/.husky/ @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/.github/ @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/.husky/ @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex

/mobile-app/app/ @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/mobile-app/app/api @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/mobile-app/app/ @fullstackninja864 @pierregee @chloezxyy @nattadex
/mobile-app/app/api @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex

/shared/assets @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/shared/translations @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/mobile-app/cypress @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/shared/assets @fullstackninja864 @pierregee @chloezxyy @nattadex
/shared/translations @fullstackninja864 @pierregee @chloezxyy @nattadex
/mobile-app/cypress @fullstackninja864 @pierregee @chloezxyy @nattadex

/.codeclimate.yml @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/.versionrc.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/mobile-app/_shim.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/app.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/mobile-app/App.tsx @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/mobile-app/cypress.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/eas.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/.codeclimate.yml @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/.versionrc.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/mobile-app/_shim.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/app.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/mobile-app/App.tsx @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/mobile-app/cypress.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
/eas.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex

netlify.toml @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
babel.config.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
jest.config.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
metro.config.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
tsconfig.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
netlify.toml @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
babel.config.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
jest.config.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
metro.config.js @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex
tsconfig.json @fuxingloh @fullstackninja864 @pierregee @chloezxyy @nattadex

package.json @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
package-lock.json @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
/docker-compose.yml @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
package.json @fullstackninja864 @pierregee @chloezxyy @nattadex
package-lock.json @fullstackninja864 @pierregee @chloezxyy @nattadex
/docker-compose.yml @fullstackninja864 @pierregee @chloezxyy @nattadex

BETA_TESTING.md @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
CONTRIBUTING.md @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
README.md @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
LICENSE @fullstackninja864 @pierregee @chloezxyy @lykalabrada @nattadex
BETA_TESTING.md @fullstackninja864 @pierregee @chloezxyy @nattadex
CONTRIBUTING.md @fullstackninja864 @pierregee @chloezxyy @nattadex
README.md @fullstackninja864 @pierregee @chloezxyy @nattadex
LICENSE @fullstackninja864 @pierregee @chloezxyy @nattadex
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export interface PortfolioRowToken extends WalletToken {
export function PortfolioScreen({ navigation }: Props): JSX.Element {
const { isLight } = useThemeContext();
const { domain } = useDomainContext();
const isEvmDomain = domain === DomainType.EVM;
const isFocused = useIsFocused();
const height = useBottomTabBarHeight();
const client = useWhaleApiClient();
Expand Down Expand Up @@ -204,7 +205,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {
);
const { evmTokens } = useEvmTokenBalances();
const { totalAvailableValue, dstTokens } = useMemo(() => {
return (domain === DomainType.EVM ? evmTokens : tokens).reduce(
return (isEvmDomain ? evmTokens : tokens).reduce(
(
{
totalAvailableValue,
Expand Down Expand Up @@ -249,7 +250,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {

// add token that are 100% locked as collateral into dstTokens
const combinedTokens = useMemo(() => {
if (lockedTokens === undefined || lockedTokens.size === 0) {
if (lockedTokens === undefined || lockedTokens.size === 0 || isEvmDomain) {
return dstTokens;
}

Expand Down Expand Up @@ -682,13 +683,12 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {
}}
isSorted={isSorted}
denominationCurrency={denominationCurrency}
isEvmDomain={domain === DomainType.EVM}
isEvmDomain={isEvmDomain}
/>
{activeButtonGroup === ButtonGroupTabKey.AllTokens && (
<DFIBalanceCard denominationCurrency={denominationCurrency} />
)}
{!hasFetchedToken ||
(domain === DomainType.EVM && !hasFetchedEvmTokens) ? (
{!hasFetchedToken || (isEvmDomain && !hasFetchedEvmTokens) ? (
<View style={tailwind("px-5")}>
<SkeletonLoader row={2} screen={SkeletonLoaderScreen.Portfolio} />
</View>
Expand All @@ -703,7 +703,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {
onButtonGroupPress: handleButtonFilter,
}}
denominationCurrency={denominationCurrency}
isEvmDomain={domain === DomainType.EVM}
isEvmDomain={isEvmDomain}
/>
)}
{Platform.OS === "web" ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function ActionButtons(): JSX.Element {
<ScrollView
contentContainerStyle={tailwind(
"flex justify-between min-w-full px-5 mt-8",
{ "max-w-xs px-9": isEvmDomain },
{ "max-w-xs px-20": isEvmDomain },
)}
showsHorizontalScrollIndicator={false}
horizontal
Expand All @@ -154,20 +154,33 @@ export function ActionButtons(): JSX.Element {
onPress={() => navigation.navigate("GetDFIScreen")}
/>
)}
<ActionButton
name={translate("components/ActionButtons", "Send")}
icon="arrow-up-right"
iconType="Feather"
iconSize={28}
testID="send_balance_button"
onPress={() => {
navigation.navigate({
name: "TokenSelectionScreen",
params: {},
merge: true,
});
}}
/>
{!isEvmDomain && (
<ActionButton
name={translate("components/ActionButtons", "Send")}
icon="arrow-up-right"
iconType="Feather"
iconSize={28}
testID="send_balance_button"
onPress={() => {
navigation.navigate({
name: "TokenSelectionScreen",
params: {},
merge: true,
});
}}
/>
)}
{isEvmDomain && isEvmFeatureEnabled && (
<ActionButton
name={translate("components/ActionButtons", "Convert")}
iconSize={28}
testID="convert_action_button"
onPress={() => {
navigateToTokenSelectionScreen(TokenListType.From);
}}
isEvmDomain
/>
)}
<ActionButton
name={translate("components/ActionButtons", "Receive")}
icon="arrow-down-left"
Expand All @@ -191,7 +204,7 @@ export function ActionButtons(): JSX.Element {
}
/>
)}
{isEvmFeatureEnabled && (
{!isEvmDomain && isEvmFeatureEnabled && (
<ActionButton
name={translate("components/ActionButtons", "Convert")}
iconSize={28}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,32 +238,34 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element {
>
{token.id !== "0" && (
<>
<TokenActionRow
icon="arrow-up-right"
iconType="Feather"
isLast={false}
onPress={() =>
navigation.navigate({
name: "SendScreen",
params: { token },
merge: true,
})
}
testID="send_button"
title={translate(
"screens/TokenDetailScreen",
"Send to other wallet",
)}
/>
{!isEvmDomain && (
<TokenActionRow
icon="arrow-up-right"
iconType="Feather"
isLast={false}
onPress={() =>
navigation.navigate({
name: "SendScreen",
params: { token },
merge: true,
})
}
testID="send_button"
title={translate(
"screens/TokenDetailScreen",
"Send to other wallet",
)}
/>
)}

<TokenActionRow
icon="arrow-down-left"
iconType="Feather"
isLast={
!(
token.symbol === "DFI" ||
(token.isLPS && pair !== undefined) ||
(pair !== undefined && !token.isLPS)
(token.isLPS && pair !== undefined && !isEvmDomain) ||
(pair !== undefined && !token.isLPS && !isEvmDomain)
)
}
onPress={() => navigation.navigate("Receive")}
Expand Down Expand Up @@ -370,7 +372,7 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element {
)}
/>
)}
{pair !== undefined && !token.isLPS && (
{pair !== undefined && !token.isLPS && !isEvmDomain && (
<TokenActionRow
icon="plus-circle"
iconType="Feather"
Expand All @@ -389,7 +391,7 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element {

{/* Show only for LP tokens */}
<View style={tailwind("px-5")}>
{pair !== undefined && token.isLPS && (
{pair !== undefined && token.isLPS && !isEvmDomain && (
<View style={tailwind("pt-4")}>
<ButtonV2
onPress={() =>
Expand Down Expand Up @@ -427,7 +429,8 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element {

{!token.isLPS &&
pair !== undefined &&
swapTokenDisplaySymbol !== undefined && (
swapTokenDisplaySymbol !== undefined &&
!isEvmDomain && (
<View style={tailwind("pt-4")}>
<ButtonV2
onPress={() => onNavigateSwap({ pair })}
Expand Down
Loading