diff --git a/example/src/pages/Modules.tsx b/example/src/pages/Modules.tsx index 7b6314ba..550a515b 100644 --- a/example/src/pages/Modules.tsx +++ b/example/src/pages/Modules.tsx @@ -5,7 +5,6 @@ import { ModuleCheckout, ModuleCredential, ModuleIDP, - ModuleNavigation, ModulePaymentNotice, useIOExperimentalDesign, useIOTheme @@ -257,41 +256,6 @@ const renderModuleCredential = () => ( ); -const renderModuleNavigation = () => ( - <> - - - - - - - - - - - - - - - - -); - const Modules = () => { const { isExperimental, setExperimental } = useIOExperimentalDesign(); const theme = useIOTheme(); @@ -342,14 +306,6 @@ const Modules = () => { ModuleCredential {renderModuleCredential()} -

- ModuleNavigation -

- {renderModuleNavigation()} ); }; diff --git a/src/components/modules/ModuleNavigation.tsx b/src/components/modules/ModuleNavigation.tsx deleted file mode 100644 index f0fb2cf2..00000000 --- a/src/components/modules/ModuleNavigation.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import React from "react"; -import { - Image, - ImageSourcePropType, - ImageURISource, - StyleSheet, - View -} from "react-native"; -import Placeholder from "rn-placeholder"; -import { - IOListItemVisualParams, - IOModuleStyles, - IOSelectionListItemVisualParams, - IOStyles, - useIOTheme -} from "../../core"; -import { WithTestID } from "../../utils/types"; -import { Badge } from "../badge"; -import { IOIcons, Icon } from "../icons"; -import { VSpacer } from "../spacer"; -import { Chip, LabelSmallAlt } from "../typography"; -import { - PressableModuleBase, - PressableModuleBaseProps -} from "./PressableModuleBase"; - -type LoadingProps = { - isLoading: true; -}; - -type ImageProps = - | { icon: IOIcons; image?: never } - | { icon?: never; image: ImageURISource | ImageSourcePropType }; - -type BaseProps = { - isLoading?: false; - title: string; - subtitle?: string; - badge?: Badge; -} & ImageProps & - PressableModuleBaseProps; - -type ModuleNavigationProps = LoadingProps | BaseProps; - -export const ModuleNavigation = (props: WithTestID) => { - const theme = useIOTheme(); - - if (props.isLoading) { - return ; - } - - const { icon, image, title, subtitle, onPress, badge, ...pressableProps } = - props; - - const iconComponent = ( - <> - {icon && } - {image && ( - - )} - - ); - - return ( - - {iconComponent} - - - {title} - - {subtitle && {subtitle}} - - - {badge ? ( - - ) : onPress ? ( - - ) : null} - - - ); -}; - -const ModuleNavigationSkeleton = () => ( - - - - - - - - - - - -); - -const styles = StyleSheet.create({ - image: { - width: IOSelectionListItemVisualParams.iconSize, - height: IOSelectionListItemVisualParams.iconSize, - resizeMode: "contain" - } -}); diff --git a/src/components/modules/index.tsx b/src/components/modules/index.tsx index f3957d35..c55410c9 100644 --- a/src/components/modules/index.tsx +++ b/src/components/modules/index.tsx @@ -2,6 +2,5 @@ export * from "./ModuleAttachment"; export * from "./ModuleCheckout"; export * from "./ModuleCredential"; export * from "./ModuleIDP"; -export * from "./ModuleNavigation"; export * from "./ModulePaymentNotice"; export * from "./PressableModuleBase";