Skip to content
Closed
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
8 changes: 4 additions & 4 deletions app/actions/transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function newAssetTransaction(selectedAsset) {
assetType: selectedAsset.isETH
? ETH
: selectedAsset.tokenId
? ERC721
: ERC20,
? ERC721
: ERC20,
};
}

Expand Down Expand Up @@ -68,8 +68,8 @@ export function setSelectedAsset(selectedAsset) {
assetType: selectedAsset.isETH
? ETH
: selectedAsset.tokenId
? ERC721
: ERC20,
? ERC721
: ERC20,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const createMockAccountGroup = (
hidden: false,
},
accounts: accounts as [string],
}) as AccountGroupObject;
} as AccountGroupObject);

const mockAccountGroup1 = createMockAccountGroup(
'wallet-1/group-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,10 @@ export const createMockWallet = (
type: ExtendedKeyringTypes.simple,
},
},
groups: groups.reduce(
(acc, group) => {
acc[group.id] = group;
return acc;
},
{} as Record<string, AccountGroupObject>,
),
groups: groups.reduce((acc, group) => {
acc[group.id] = group;
return acc;
}, {} as Record<string, AccountGroupObject>),
};

return wallet as unknown as AccountWalletObject;
Expand All @@ -123,13 +120,10 @@ export const createMockEntropyWallet = (
id: 'test-entropy-id',
},
},
groups: groups.reduce(
(acc, group) => {
acc[group.id] = group;
return acc;
},
{} as Record<string, AccountGroupObject>,
),
groups: groups.reduce((acc, group) => {
acc[group.id] = group;
return acc;
}, {} as Record<string, AccountGroupObject>),
};

return wallet as unknown as AccountWalletObject;
Expand All @@ -142,18 +136,15 @@ export const createMockState = (
wallets: AccountWalletObject[],
internalAccounts: Record<string, InternalAccount>,
): RootState => {
const walletMap = wallets.reduce(
(acc, wallet) => {
const prefixedKey = `${wallet.type}:${wallet.id}`;
const walletMap = wallets.reduce((acc, wallet) => {
const prefixedKey = `${wallet.type}:${wallet.id}`;

// Store with both prefixed key (for selectors) and plain key (for AccountListFooter)
acc[prefixedKey] = wallet;
acc[wallet.id] = wallet;
// Store with both prefixed key (for selectors) and plain key (for AccountListFooter)
acc[prefixedKey] = wallet;
acc[wallet.id] = wallet;

return acc;
},
{} as Record<string, AccountWalletObject>,
);
return acc;
}, {} as Record<string, AccountWalletObject>);

const firstWallet = wallets[0];
const firstGroupId = Object.keys(firstWallet?.groups ?? [])[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getCalculatedTokenAmount1dAgo = (
) =>
tokenPricePercentChange1dAgo !== undefined && tokenFiatBalance
? tokenFiatBalance / (1 + tokenPricePercentChange1dAgo / 100)
: (tokenFiatBalance ?? 0);
: tokenFiatBalance ?? 0;

const isValidAmount = (amount: number | null | undefined): boolean =>
amount !== null && amount !== undefined && !Number.isNaN(amount);
Expand Down
4 changes: 2 additions & 2 deletions app/component-library/components-temp/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const Tab: React.FC<TabProps> = ({
isDisabled
? 'text-muted'
: isActive
? 'text-default'
: 'text-alternative'
? 'text-default'
: 'text-alternative'
}
numberOfLines={1}
style={tw.style('absolute inset-0 flex items-center justify-center')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ Optional prop to configure the color of the BottomSheetOverlay.

| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> |
| :-------------------------------------------------- | :------------------------------------------------------ |
| ColorValue | No |
| ColorValue | No |

### `onPress`

Function to trigger when pressing the BottomSheetOverlay.

| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> |
| :-------------------------------------------------- | :------------------------------------------------------ |
| Function | No |
| Function | No |

## Usage

```javascript
<BottomSheetOverlay onPress={() => {}}/>;
<BottomSheetOverlay onPress={() => {}} />
```
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const ButtonLink: React.FC<ButtonLinkProps> = ({
? DEFAULT_BUTTONLINK_LABEL_COLOR_ERROR_PRESSED
: DEFAULT_BUTTONLINK_LABEL_COLOR_ERROR
: pressed
? DEFAULT_BUTTONLINK_LABEL_COLOR_PRESSED
: DEFAULT_BUTTONLINK_LABEL_COLOR;
? DEFAULT_BUTTONLINK_LABEL_COLOR_PRESSED
: DEFAULT_BUTTONLINK_LABEL_COLOR;

const renderLabel = () =>
typeof label === 'string' ? (
Expand Down
20 changes: 10 additions & 10 deletions app/component-library/components/Checkbox/Checkbox.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ const styleSheet = (params: { theme: Theme; vars: CheckboxStyleSheetVars }) => {
const backgroundColor = isReadOnly
? theme.colors.background.alternative
: isDanger
? isChecked || isIndeterminate
? theme.colors.error.default
: theme.colors.background.default
: isChecked || isIndeterminate
? theme.colors.primary.default
: theme.colors.background.default;
? isChecked || isIndeterminate
? theme.colors.error.default
: theme.colors.background.default
: isChecked || isIndeterminate
? theme.colors.primary.default
: theme.colors.background.default;

const borderColor = isReadOnly
? theme.colors.background.alternative
: isDanger
? theme.colors.error.default
: isChecked || isIndeterminate
? theme.colors.primary.default
: theme.colors.icon.default;
? theme.colors.error.default
: isChecked || isIndeterminate
? theme.colors.primary.default
: theme.colors.icon.default;

return StyleSheet.create({
base: Object.assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ function TradeTabBarItem({ label, ...props }: TradeTabBarItemProps) {
themeAppearance === 'light'
? IconColor.Inverse
: isActive
? IconColor.Inverse
: IconColor.Default;
? IconColor.Inverse
: IconColor.Default;
return (
<Pressable
style={tw.style(
Expand Down
5 changes: 5 additions & 0 deletions app/components/Nav/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import WalletActions from '../../Views/WalletActions';
import FundActionMenu from '../../UI/FundActionMenu';
import NetworkSelector from '../../../components/Views/NetworkSelector';
import ReturnToAppNotification from '../../Views/ReturnToAppNotification';
import CardNotification from '../../Views/CardNotification';
import EditAccountName from '../../Views/EditAccountName/EditAccountName';
import LegacyEditMultichainAccountName from '../../Views/MultichainAccounts/sheets/EditAccountName';
import { EditMultichainAccountName } from '../../Views/MultichainAccounts/sheets/EditMultichainAccountName';
Expand Down Expand Up @@ -573,6 +574,10 @@ const RootModalFlow = (props: RootModalFlowProps) => (
component={ReturnToAppNotification}
initialParams={{ ...props.route.params }}
/>
<Stack.Screen
name={Routes.CARD.NOTIFICATION}
component={CardNotification}
/>
</Stack.Navigator>
);

Expand Down
5 changes: 3 additions & 2 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ const Main = (props) => {
if (isSeedlessPasswordOutdated) {
// Check for latest seedless password outdated state
// isSeedlessPasswordOutdated is true when navigate to wallet main screen after login with password sync
const isOutdated =
await Authentication.checkIsSeedlessPasswordOutdated(false);
const isOutdated = await Authentication.checkIsSeedlessPasswordOutdated(
false,
);
if (!isOutdated) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ describe('SnapUIAssetSelector', () => {
const usdcNameOnButton = await within(selectorButton).findByText('USDC');
expect(usdcNameOnButton).toBeTruthy();

const solanaNetworkOnButton =
await within(selectorButton).findByText('Solana');
const solanaNetworkOnButton = await within(selectorButton).findByText(
'Solana',
);
expect(solanaNetworkOnButton).toBeTruthy();

const solSymbolOnButton = queryByText('SOL');
Expand Down
6 changes: 2 additions & 4 deletions app/components/UI/AccountInfoCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,12 @@ class AccountInfoCard extends PureComponent {
const originatorInfo = currentConnection?.originatorInfo;

const sdkDappMetadata = {
url: isOriginUrl
? origin
: (originatorInfo?.url ?? strings('sdk.unknown')),
url: isOriginUrl ? origin : originatorInfo?.url ?? strings('sdk.unknown'),
icon: originatorInfo?.icon,
};
const actualOriginUrl = isOriginUrl
? origin
: (originatorInfo?.url ?? strings('sdk.unknown'));
: originatorInfo?.url ?? strings('sdk.unknown');

return operation === 'signing' && transaction !== undefined ? (
<ApproveTransactionHeader
Expand Down
12 changes: 6 additions & 6 deletions app/components/UI/AddCustomToken/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,20 +533,20 @@ class AddCustomToken extends PureComponent {
const addressInputStyle = onFocusAddress
? { ...styles.textInput, ...styles.textInputFocus }
: warningAddress
? styles.textInputError
: styles.textInput;
? styles.textInputError
: styles.textInput;

const textInputDecimalsStyle = !isDecimalEditable
? { ...styles.textInput, ...styles.textInputDisabled }
: warningDecimals
? styles.textInputError
: styles.textInput;
? styles.textInputError
: styles.textInput;

const textInputSymbolStyle = !isSymbolEditable
? { ...styles.textInput, ...styles.textInputDisabled }
: warningSymbol
? styles.textInputError
: styles.textInput;
? styles.textInputError
: styles.textInput;

const { title, url } = getBlockExplorerAddressUrl(
this.props.type,
Expand Down
8 changes: 4 additions & 4 deletions app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ const ApprovalTagUrl = ({
const imageSource = faviconSource?.uri
? faviconSource
: sdkDappMetadata?.icon
? { uri: sdkDappMetadata.icon }
: {
uri: '',
};
? { uri: sdkDappMetadata.icon }
: {
uri: '',
};

const showOrigin =
origin && !isOriginDeepLink && !INTERNAL_ORIGINS.includes(origin);
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/AssetOverview/Price/Price.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const styleSheet = (params: {
priceDiff > 0
? colors.success.default
: priceDiff < 0
? colors.error.default
: colors.text.alternative,
? colors.error.default
: colors.text.alternative,
} as TextStyle,
priceDiffIcon: {
marginTop: 10,
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/AssetOverview/Price/Price.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ const Price = ({
diff > 0
? 'trending-up'
: diff < 0
? 'trending-down'
: 'minus'
? 'trending-down'
: 'minus'
}
size={16}
style={styles.priceDiffIcon}
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/AssetOverview/PriceChart/PriceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const PriceChart = ({
priceDiff > 0
? theme.colors.primary.default
: priceDiff < 0
? theme.colors.primary.default
: theme.colors.text.alternative;
? theme.colors.primary.default
: theme.colors.text.alternative;

const apx = (size = 0) => {
const width = Dimensions.get('window').width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ const BasicFunctionalityModal = ({ route }: Props) => {
<Text variant={TextVariant.BodyMD} style={styles.description}>
{strings('default_settings.sheet.description_off2')}{' '}
<Text variant={TextVariant.BodyMDBold} style={styles.description}>
{strings(
'default_settings.sheet.description_off2_related_features1',
)}{' '}
{strings('default_settings.sheet.description_off2_related_features1')}{' '}
</Text>
<Text variant={TextVariant.BodyMD} style={styles.description}>
{strings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Blockaid Validation Logic', () => {
trade: {} as QuoteResponse['trade'],
estimatedProcessingTimeInSeconds: 60,
// Add other required properties as needed
}) as unknown as QuoteResponse & QuoteMetadata;
} as unknown as QuoteResponse & QuoteMetadata);

it('should navigate to blockaid modal with validation error', async () => {
const mockQuote = createMockQuote('test-quote');
Expand Down
8 changes: 4 additions & 4 deletions app/components/UI/Bridge/Views/BridgeView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,10 @@ const BridgeView = () => {
feePercentage,
})
: !hasFee && isNoFeeDestinationAsset
? strings('bridge.no_mm_fee_disclaimer', {
destTokenSymbol: destToken?.symbol,
})
: ''}
? strings('bridge.no_mm_fee_disclaimer', {
destTokenSymbol: destToken?.symbol,
})
: ''}
{approval
? ` ${strings('bridge.approval_needed', approval)}`
: ''}{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ const QuoteDetailsCard: React.FC = () => {
isRewardsLoading
? RewardAnimationState.Loading
: hasRewardsError
? RewardAnimationState.ErrorState
: RewardAnimationState.Idle
? RewardAnimationState.ErrorState
: RewardAnimationState.Idle
}
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ const TokenInsightsSheet: React.FC = () => {
priceChange24h > 0
? TextColor.Success
: priceChange24h < 0
? TextColor.Error
: TextColor.Alternative
? TextColor.Error
: TextColor.Alternative
}
>
{formatPercentChange(priceChange24h)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ export const BridgeTransactionDetails = (
estimatedCompletionString && (
<Box style={styles.detailRow}>
<Text variant={TextVariant.BodyMDMedium}>
{strings(
'bridge_transaction_details.estimated_completion',
)}{' '}
{strings('bridge_transaction_details.estimated_completion')}{' '}
</Text>
<Box
flexDirection={FlexDirection.Row}
Expand Down
Loading
Loading