Skip to content

Commit

Permalink
chore: hide last carousel cards at first time mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
tanlethanh committed Jul 7, 2024
1 parent 5144700 commit 8642485
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/wallet/src/features/Explorer/Highlights/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect } from 'react';
import type { FC } from 'react';
import { useEffect } from 'react';
import { StyleSheet } from 'react-native';
import type { SharedValue, WithTimingConfig } from 'react-native-reanimated';
import Animated, {
Expand Down Expand Up @@ -46,8 +47,10 @@ const Card: FC<Props> = ({
[0.08, -0.08],
);

const isHidden = index - currentIndex > 2;

return {
opacity: opacity.value,
opacity: isHidden ? 0 : opacity.value,
transform: [
{ translateX: xOffset.value + addingTranslateX },
{ scale: scale.value + addingScale },
Expand Down

0 comments on commit 8642485

Please sign in to comment.