Skip to content

Commit

Permalink
feat: add animations to transaction operation expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
nelitow committed Jan 31, 2025
1 parent 8075534 commit 15a8061
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Box, Icon, Text } from '@fuel-ui/react';
import type { AssetFuelAmount } from '@fuel-wallet/types';
import { useEffect, useState } from 'react';
import { AssetsCache } from '~/systems/Asset/cache/AssetsCache';
import { MotionBox, animations } from '~/systems/Core';
import { NetworkService } from '~/systems/Network/services/network';
import { TxCategory } from '../../../../types';
import type { SimplifiedOperation } from '../../../../types';
Expand Down Expand Up @@ -89,7 +90,8 @@ export function TxOperation({
<Box.VStack>
<TxOperationCard operation={operation} assetsAmount={assetsAmount} />
{metadata.operationCount && metadata.operationCount > 1 && (
<Box
<MotionBox
{...animations.fadeIn()}
css={styles.operationCount}
onClick={() => setIsExpanded(!isExpanded)}
>
Expand All @@ -105,18 +107,19 @@ export function TxOperation({
(+{metadata.operationCount} operations)
</Text>
)}
</Box>
</MotionBox>
)}
{isExpanded && (
<Box css={styles.expandedOperations}>
<MotionBox {...animations.slideInTop()} css={styles.expandedOperations}>
{metadata.childOperations?.map((op, idx) => (
<TxOperationCard
key={`${op.type}-${op.from.address}-${op.to.address}-${idx}`}
operation={op}
assetsAmount={[]}
depth={depth}
/>
))}
</Box>
</MotionBox>
)}
</Box.VStack>
);
Expand Down

0 comments on commit 15a8061

Please sign in to comment.