Skip to content

Commit

Permalink
fix(conflict): fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada committed Oct 3, 2023
2 parents a205bc0 + 31cd4ab commit 6e84732
Show file tree
Hide file tree
Showing 18 changed files with 622 additions and 252 deletions.
10 changes: 2 additions & 8 deletions mobile-app/app/api/transaction/transfer_domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ export async function transferDomainSigner(
token: stripEvmSuffixFromTokenId(sourceTokenId),
amount: amount,
},
data:
convertDirection === ConvertDirection.evmToDvm
? evmTx
: new Uint8Array([]),
data: isEvmToDvm ? evmTx : new Uint8Array([]),
},
dst: {
address: dstScript,
Expand All @@ -111,10 +108,7 @@ export async function transferDomainSigner(
token: stripEvmSuffixFromTokenId(targetTokenId),
amount: amount,
},
data:
convertDirection === ConvertDirection.dvmToEvm
? evmTx
: new Uint8Array([]),
data: isEvmToDvm ? new Uint8Array([]) : evmTx,
},
},
],
Expand Down
106 changes: 76 additions & 30 deletions mobile-app/app/components/SummaryTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { getNativeIcon } from "@components/icons/assets";
import { translate } from "@translations";
import { RandomAvatar } from "@screens/AppNavigator/screens/Portfolio/components/RandomAvatar";
import { AddressType } from "@waveshq/walletkit-ui/dist/store";
import { LocalAddress, WhitelistedAddress } from "@store/userPreferences";
import { DomainType } from "@contexts/DomainContext";
import { LinearGradient } from "expo-linear-gradient";
import { View } from ".";
import { ThemedTextV2, ThemedViewV2 } from "./themed";
import { EVMLinearGradient } from "./EVMLinearGradient";
Expand All @@ -22,6 +25,7 @@ interface ISummaryTitleProps {
iconB?: string;
addressType?: AddressType;
amountTextStyle?: string;
matchedAddress?: LocalAddress | WhitelistedAddress;
isEvmToken?: boolean;
}

Expand Down Expand Up @@ -123,39 +127,81 @@ export function SummaryTitle(props: ISummaryTitleProps): JSX.Element {
>
{props.customToAddressTitle ?? translate("screens/common", "To")}
</ThemedTextV2>
<ThemedViewV2
dark={tailwind("bg-mono-dark-v2-200")}
light={tailwind("bg-mono-light-v2-200")}
style={tailwind(
"flex flex-row items-center overflow-hidden rounded-full pr-2.5 py-1 ml-2",
{
"pl-1": props.addressType === AddressType.WalletAddress,
"pl-2.5": props.addressType !== AddressType.WalletAddress,
},
)}
>
{props.addressType === AddressType.WalletAddress && (
<View style={tailwind("mr-1")}>
<RandomAvatar name={props.toAddress} size={20} />
</View>
)}
<ThemedTextV2
ellipsizeMode="middle"
numberOfLines={1}
style={[
tailwind("text-sm font-normal-v2"),
{/* TODO @chloe cater for selection of evm addr from addr pair */}
{(props.matchedAddress as WhitelistedAddress)?.addressDomainType ===
DomainType.EVM ? (
<LinearGradient
colors={["#42F9C2", "#3B57CF"]}
start={[0, 0]}
end={[1, 1]}
style={tailwind(
"flex flex-row items-center overflow-hidden rounded-full pr-2.5 py-1 ml-2",
{
minWidth: 10,
maxWidth: 108,
"pl-1": props.addressType === AddressType.WalletAddress,
"pl-2.5": props.addressType !== AddressType.WalletAddress,
},
]}
testID="summary_to_value"
)}
testID="to_address_label_evm_tag"
>
{props.toAddressLabel != null && props.toAddressLabel.length > 0
? props.toAddressLabel
: props.toAddress}
</ThemedTextV2>
</ThemedViewV2>
{props.addressType === AddressType.WalletAddress && (
<View style={tailwind("mr-1")}>
<RandomAvatar name={props.toAddress} size={20} />
</View>
)}
<ThemedTextV2
ellipsizeMode="middle"
numberOfLines={1}
style={[
tailwind("text-sm font-normal-v2"),
{
minWidth: 10,
maxWidth: 108,
},
]}
testID="summary_to_value"
>
{props.toAddressLabel != null &&
props.toAddressLabel.length > 0
? props.toAddressLabel
: props.toAddress}
</ThemedTextV2>
</LinearGradient>
) : (
<ThemedViewV2
dark={tailwind("bg-mono-dark-v2-200")}
light={tailwind("bg-mono-light-v2-200")}
style={tailwind(
"flex flex-row items-center overflow-hidden rounded-full pr-2.5 py-1 ml-2",
{
"pl-1": props.addressType === AddressType.WalletAddress,
"pl-2.5": props.addressType !== AddressType.WalletAddress,
},
)}
>
{props.addressType === AddressType.WalletAddress && (
<View style={tailwind("mr-1")}>
<RandomAvatar name={props.toAddress} size={20} />
</View>
)}
<ThemedTextV2
ellipsizeMode="middle"
numberOfLines={1}
style={[
tailwind("text-sm font-normal-v2"),
{
minWidth: 10,
maxWidth: 108,
},
]}
testID="summary_to_value"
>
{props.toAddressLabel != null &&
props.toAddressLabel.length > 0
? props.toAddressLabel
: props.toAddress}
</ThemedTextV2>
</ThemedViewV2>
)}
</View>
)}
</View>
Expand Down
1 change: 0 additions & 1 deletion mobile-app/app/hooks/useWalletAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function useWalletAddress(): {
for (let i = 0; i <= addressLength; i++) {
const account = wallet.get(i);
const dvm = await account.getAddress();
// TODO (Harsh) replace it with getEvmAddress
const evm = await account.getEvmAddress();
addresses.push({ dvm, evm });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BarCodeScanner } from "@components/BarCodeScanner";
import { HeaderTitle } from "@components/HeaderTitle";
import { tailwind } from "@tailwind";
import { translate } from "@translations";
import { WhitelistedAddress } from "@store/userPreferences";
import { LocalAddress, WhitelistedAddress } from "@store/userPreferences";
import { FutureSwapData } from "@store/futureSwap";
import { TransactionsScreen } from "@screens/AppNavigator/screens/Transactions/TransactionsScreen";
import { TransactionDetailScreen } from "@screens/AppNavigator/screens/Transactions/screens/TransactionDetailScreen";
Expand Down Expand Up @@ -78,6 +78,7 @@ export interface PortfolioParamList {
toAddressLabel?: string;
addressType?: AddressType;
originScreen?: ScreenName;
matchedAddress?: WhitelistedAddress | LocalAddress;
};
TokenDetailScreen: { token: WalletToken };
ConvertScreen: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,18 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element {

return filteredTokens.sort(sortTokensFunc);
},
[filteredTokens, assetSortType, denominationCurrency],
[domain, filteredTokens, assetSortType, denominationCurrency],
);

useEffect(() => {
setAssetSortType(PortfolioSortType.HighestDenominationValue); // reset sorting state upon denominationCurrency change
}, [denominationCurrency]);

// Reset button group in EVM domain
useEffect(() => {
setActiveButtonGroup(ButtonGroupTabKey.AllTokens);
}, [domain]);

// token tab items
const [activeButtonGroup, setActiveButtonGroup] = useState<ButtonGroupTabKey>(
ButtonGroupTabKey.AllTokens,
Expand Down
Loading

0 comments on commit 6e84732

Please sign in to comment.