-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into PE-732-CGN-header-on-scroll
- Loading branch information
Showing
12 changed files
with
270 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ures/payments/bizEventsTransaction/components/PaymentsBizEventsFadeInOutAnimationView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
import { IOStyles } from "@pagopa/io-app-design-system"; | ||
import Animated, { FadeIn, FadeOut } from "react-native-reanimated"; | ||
|
||
export const PaymentsBizEventsFadeInOutAnimationView = React.memo( | ||
({ children }: { children: React.ReactNode }) => ( | ||
<Animated.View | ||
style={IOStyles.flex} | ||
exiting={FadeOut.duration(200)} | ||
entering={FadeIn.duration(200)} | ||
> | ||
{children} | ||
</Animated.View> | ||
), | ||
() => true | ||
); |
64 changes: 64 additions & 0 deletions
64
ts/features/payments/bizEventsTransaction/components/PaymentsBizEventsFilterTabs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { | ||
IOVisualCostants, | ||
TabItem, | ||
TabNavigation, | ||
VSpacer | ||
} from "@pagopa/io-app-design-system"; | ||
import React from "react"; | ||
import { StyleSheet, View } from "react-native"; | ||
import { | ||
PaymentBizEventsCategoryFilter, | ||
paymentsBizEventsCategoryFilters | ||
} from "../types"; | ||
import I18n from "../../../../i18n"; | ||
|
||
type PaymentsBizEventsFilterTabsProps = { | ||
selectedCategory: PaymentBizEventsCategoryFilter; | ||
onCategorySelected?: (category: PaymentBizEventsCategoryFilter) => void; | ||
}; | ||
|
||
const PaymentsBizEventsFilterTabs = ({ | ||
selectedCategory, | ||
onCategorySelected | ||
}: PaymentsBizEventsFilterTabsProps) => { | ||
const selectedIndexOfCategory = | ||
paymentsBizEventsCategoryFilters.indexOf(selectedCategory); | ||
|
||
const handleFilterSelected = (index: number) => { | ||
const categoryByIndex = paymentsBizEventsCategoryFilters[index]; | ||
onCategorySelected?.(categoryByIndex); | ||
}; | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<TabNavigation | ||
tabAlignment="start" | ||
onItemPress={handleFilterSelected} | ||
selectedIndex={selectedIndexOfCategory} | ||
> | ||
{paymentsBizEventsCategoryFilters.map(category => ( | ||
<TabItem | ||
testID={`CategoryTabTestID-${category}`} | ||
key={category} | ||
label={I18n.t( | ||
`features.payments.transactions.filters.tabs.${category}` | ||
)} | ||
accessibilityLabel={I18n.t( | ||
`features.payments.transactions.filters.tabs.${category}` | ||
)} | ||
/> | ||
))} | ||
</TabNavigation> | ||
<VSpacer size={16} /> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
marginHorizontal: -IOVisualCostants.appMarginDefault * 2, | ||
paddingHorizontal: IOVisualCostants.appMarginDefault | ||
} | ||
}); | ||
|
||
export { PaymentsBizEventsFilterTabs }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ures/payments/bizEventsTransaction/components/PaymentsBizEventsTransactionLoadingList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ListItemTransaction, VSpacer } from "@pagopa/io-app-design-system"; | ||
import * as React from "react"; | ||
import Placeholder from "rn-placeholder"; | ||
import { PaymentsBizEventsFadeInOutAnimationView } from "./PaymentsBizEventsFadeInOutAnimationView"; | ||
|
||
export type PaymentsBizEventsTransactionLoadingListProps = { | ||
showSectionTitleSkeleton?: boolean; | ||
}; | ||
|
||
export const PaymentsBizEventsTransactionLoadingList = ({ | ||
showSectionTitleSkeleton | ||
}: PaymentsBizEventsTransactionLoadingListProps) => ( | ||
<> | ||
{showSectionTitleSkeleton && ( | ||
<> | ||
<VSpacer size={16} /> | ||
<Placeholder.Box animate="fade" radius={8} width={62} height={16} /> | ||
<VSpacer size={16} /> | ||
</> | ||
)} | ||
|
||
{Array.from({ length: 5 }).map((_, index) => ( | ||
<PaymentsBizEventsFadeInOutAnimationView key={index}> | ||
<ListItemTransaction | ||
isLoading={true} | ||
transactionStatus="success" | ||
transactionAmount="" | ||
title="" | ||
subtitle="" | ||
/> | ||
</PaymentsBizEventsFadeInOutAnimationView> | ||
))} | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.