diff --git a/ts/features/design-system/core/DSWallet.tsx b/ts/features/design-system/core/DSWallet.tsx index 80f2c5e95b4..eef16f1a194 100644 --- a/ts/features/design-system/core/DSWallet.tsx +++ b/ts/features/design-system/core/DSWallet.tsx @@ -1,9 +1,4 @@ -import { - Banner, - ListItemSwitch, - VSpacer, - VStack -} from "@pagopa/io-app-design-system"; +import { Banner, VSpacer, VStack } from "@pagopa/io-app-design-system"; import * as React from "react"; import { CredentialType } from "../../itwallet/common/utils/itwMocksUtils"; import { WalletCardsCategoryContainer } from "../../newWallet/components/WalletCardsCategoryContainer"; @@ -12,8 +7,6 @@ import { DesignSystemScreen } from "../components/DesignSystemScreen"; import { DesignSystemSection } from "../components/DesignSystemSection"; export const DSWallet = () => { - const [isStacked, setStacked] = React.useState(true); - const cards: ReadonlyArray = [ { key: "1", @@ -108,11 +101,6 @@ export const DSWallet = () => { return ( - { iconName: "legalValue", iconColor: "blueIO-500" }} - isStacked={isStacked} /> { header={{ label: "Altro" }} - isStacked={isStacked} topElement={ <> { ...cardsByCategory.cgn, ...cardsByCategory.bonus ]} - isStacked={isStacked} /> diff --git a/ts/features/newWallet/components/WalletCardBaseComponent.tsx b/ts/features/newWallet/components/WalletCardBaseComponent.tsx index 2f14f1a000b..fb582c46085 100644 --- a/ts/features/newWallet/components/WalletCardBaseComponent.tsx +++ b/ts/features/newWallet/components/WalletCardBaseComponent.tsx @@ -20,7 +20,7 @@ export const withWalletCardBaseComponent = >( CardContent: React.ComponentType ) => - ({ cardProps, isStacked = false, testID }: ContentProps) => + ({ cardProps, isStacked = true, testID }: ContentProps) => ( ; - isStacked?: boolean; header?: ListItemHeader; topElement?: JSX.Element; }>; @@ -33,7 +32,6 @@ const itemLayoutAnimation = */ export const WalletCardsCategoryContainer = ({ cards, - isStacked = false, header, topElement, testID @@ -44,9 +42,8 @@ export const WalletCardsCategoryContainer = ({ (!isStacked ? : null)} renderItem={({ index, item }) => - renderWalletCardFn(item, isStacked && index < cards.length - 1) + renderWalletCardFn(item, index < cards.length - 1) } itemLayoutAnimation={itemLayoutAnimation} entering={FadeInDown.duration(150)} diff --git a/ts/features/newWallet/components/WalletCardsContainer.tsx b/ts/features/newWallet/components/WalletCardsContainer.tsx index c3ffda86e2b..ee2f19b4a81 100644 --- a/ts/features/newWallet/components/WalletCardsContainer.tsx +++ b/ts/features/newWallet/components/WalletCardsContainer.tsx @@ -26,10 +26,7 @@ import { useIONavigation } from "../../../navigation/params/AppParamsList"; import { WalletCardCategoryFilter } from "../types"; import { ItwUpcomingWalletBanner } from "../../itwallet/common/components/ItwUpcomingWalletBanner"; import { WalletCardSkeleton } from "./WalletCardSkeleton"; -import { - WalletCardsCategoryContainer, - WalletCardsCategoryContainerProps -} from "./WalletCardsCategoryContainer"; +import { WalletCardsCategoryContainer } from "./WalletCardsCategoryContainer"; import { WalletEmptyScreenContent } from "./WalletEmptyScreenContent"; const EID_INFO_BOTTOM_PADDING = 128; @@ -39,15 +36,9 @@ const WalletCardsContainer = () => { const cards = useIOSelector(selectSortedWalletCards); const selectedCategory = useIOSelector(selectWalletCategoryFilter); - const stackCards = cards.length > 4; - if (isLoading && cards.length === 0) { return ( - + ); } @@ -72,18 +63,14 @@ const WalletCardsContainer = () => { > - {shouldRender("itw") && } - {shouldRender("other") && ( - - )} + {shouldRender("itw") && } + {shouldRender("other") && } ); }; -const ItwCardsContainer = ({ - isStacked -}: Pick) => { +const ItwCardsContainer = () => { const cards = useIOSelector(selectWalletItwCards); const isItwTrialEnabled = useIOSelector(isItwTrialActiveSelector); const isItwValid = useIOSelector(itwLifecycleIsValidSelector); @@ -138,7 +125,6 @@ const ItwCardsContainer = ({ key={`cards_category_itw`} testID={`walletCardsCategoryTestID_itw`} cards={cards} - isStacked={isStacked} header={getHeader()} topElement={} /> @@ -147,9 +133,7 @@ const ItwCardsContainer = ({ ); }; -const OtherCardsContainer = ({ - isStacked -}: Pick) => { +const OtherCardsContainer = () => { const cards = useIOSelector(selectWalletOtherCards); const isItwTrialEnabled = useIOSelector(isItwTrialActiveSelector); const isItwEnabled = useIOSelector(isItwEnabledSelector); @@ -166,7 +150,6 @@ const OtherCardsContainer = ({ key={`cards_category_other`} testID={`walletCardsCategoryTestID_other`} cards={cards} - isStacked={isStacked} header={ displayHeader ? {