Skip to content

Commit

Permalink
Fix typecheck error
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Feb 27, 2025
1 parent defa6df commit 51fa4b6
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,28 @@ type AccountListItemProps = ComponentPropsWithoutRef<
typeof ListBoxItem<AccountEntity>
> & {
updated: boolean;
connected: boolean;
pending: boolean;
failed: boolean;
isConnected: boolean;
isPending: boolean;
isFailed: boolean;
getBalanceQuery: (account: AccountEntity) => Binding<'account', 'balance'>;
onSelect: (id: string) => void;
};

function AccountListItem({
updated,
connected,
pending,
failed,
isConnected,
isPending,
isFailed,
getBalanceQuery,
onSelect,
...props
}: AccountListItemProps) {
const { value: account } = props;

if (!account) {
return null;
}

return (
<ListBoxItem textValue={account.id} {...props}>
{({ isDragging, isDropTarget }) => (
Expand Down Expand Up @@ -162,17 +167,17 @@ function AccountListItem({
'bankId' in account && account.bankId ? (
<View
style={{
backgroundColor: pending
backgroundColor: isPending
? theme.sidebarItemBackgroundPending
: failed
: isFailed
? theme.sidebarItemBackgroundFailed
: theme.sidebarItemBackgroundPositive,
marginRight: '8px',
width: 8,
flexShrink: 0,
height: 8,
borderRadius: 8,
opacity: connected ? 1 : 0,
opacity: isConnected ? 1 : 0,
}}
/>
) : null
Expand Down Expand Up @@ -366,9 +371,9 @@ function AccountList({
key={account.id}
value={account}
updated={updatedAccounts && updatedAccounts.includes(account.id)}
connected={!!account.bank}
pending={syncingAccountIds.includes(account.id)}
failed={failedAccounts && failedAccounts.has(account.id)}
isConnected={!!account.bank}
isPending={syncingAccountIds.includes(account.id)}
isFailed={failedAccounts && failedAccounts.has(account.id)}
getBalanceQuery={getBalanceBinding}
onSelect={id => onOpenAccount(accountListData.getItem(id))}
/>
Expand Down

0 comments on commit 51fa4b6

Please sign in to comment.