From fb21d5cf8a7bd992c244e81d74ceb3f141018fb2 Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Thu, 3 Oct 2024 05:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20Refactor:=20Remove=20Barrel=20Ex?= =?UTF-8?q?ports=20in=20`src/components`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ModalSheetView/ModalSheetView.tsx | 14 ++++++++------ src/components/ModalSheetView/index.ts | 3 --- src/components/ModalSheetViewContent/index.ts | 3 --- src/context/ModalSheetViewContext.ts | 4 +++- src/index.ts | 7 +++++-- 5 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 src/components/ModalSheetView/index.ts delete mode 100644 src/components/ModalSheetViewContent/index.ts diff --git a/src/components/ModalSheetView/ModalSheetView.tsx b/src/components/ModalSheetView/ModalSheetView.tsx index 10f2c629..e2530000 100644 --- a/src/components/ModalSheetView/ModalSheetView.tsx +++ b/src/components/ModalSheetView/ModalSheetView.tsx @@ -2,17 +2,19 @@ import * as React from 'react'; import { StyleSheet } from 'react-native'; import { Helpers } from 'react-native-ios-utilities'; +import { RNIModalSheetView, type RNIModalSheetViewRef } from '../../native_components/RNIModalSheetVIew'; + import type { ModalSheetViewProps, ModalSheetViewRef } from './ModalSheetViewTypes'; -import type { ModalSheetViewContentProps } from '../ModalSheetViewContent'; import type { ModalSheetContentMap } from './ModalSheetContentMap'; -import { RNIModalSheetView, type RNIModalSheetViewRef } from '../../native_components/RNIModalSheetVIew'; -import { ModalSheetViewContext, type ModalSheetViewContextType } from '../../context/ModalSheetViewContext'; -import { useLazyRef } from '../../hooks/useLazyRef'; +import { DEFAULT_MODAL_SHEET_VIEW_METRICS } from './ModalSheetViewConstants'; -import { DEFAULT_MODAL_SHEET_VIEW_METRICS as MODAL_SHEET_STATE_METRICS_DEFAULT } from './ModalSheetViewConstants'; +import type { ModalSheetViewContentProps } from '../ModalSheetViewContent/ModalSheetViewContentTypes'; import type { RNIModalSheetStateMetrics } from '../../types/RNIModalSheetStateMetrics'; +import { ModalSheetViewContext, type ModalSheetViewContextType } from '../../context/ModalSheetViewContext'; +import { useLazyRef } from '../../hooks/useLazyRef'; + export const ModalSheetView = React.forwardRef< ModalSheetViewRef, @@ -29,7 +31,7 @@ export const ModalSheetView = React.forwardRef< const [ currentModalSheetStateMetrics, setCurrentModalSheetStateMetrics, - ] = React.useState(MODAL_SHEET_STATE_METRICS_DEFAULT); + ] = React.useState(DEFAULT_MODAL_SHEET_VIEW_METRICS); const callbacksToInvokeOnNextRender = React.useRef void>>([]); React.useEffect(() => { diff --git a/src/components/ModalSheetView/index.ts b/src/components/ModalSheetView/index.ts deleted file mode 100644 index bed07314..00000000 --- a/src/components/ModalSheetView/index.ts +++ /dev/null @@ -1,3 +0,0 @@ - -export * from './ModalSheetView'; -export type * from './ModalSheetViewTypes'; diff --git a/src/components/ModalSheetViewContent/index.ts b/src/components/ModalSheetViewContent/index.ts deleted file mode 100644 index 9aa52898..00000000 --- a/src/components/ModalSheetViewContent/index.ts +++ /dev/null @@ -1,3 +0,0 @@ - -export * from './ModalSheetViewMainContent'; -export type * from './ModalSheetViewContentTypes'; diff --git a/src/context/ModalSheetViewContext.ts b/src/context/ModalSheetViewContext.ts index dd1d3f54..91c066ec 100644 --- a/src/context/ModalSheetViewContext.ts +++ b/src/context/ModalSheetViewContext.ts @@ -1,7 +1,9 @@ import React from 'react'; -import type { ModalSheetViewRef } from '../components/ModalSheetView'; + +import type { ModalSheetViewRef } from '../components/ModalSheetView/ModalSheetViewTypes'; import type { RNIModalSheetStateMetrics } from '../types/RNIModalSheetStateMetrics'; + export type ModalSheetViewContextType = { prevModalSheetStateMetrics: RNIModalSheetStateMetrics | undefined; currentModalSheetStateMetrics: RNIModalSheetStateMetrics; diff --git a/src/index.ts b/src/index.ts index 8ac3bef4..9a14971e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,9 @@ -export * from './components/ModalSheetView'; -export * from './components/ModalSheetViewContent'; +export * from './components/ModalSheetView/ModalSheetView'; +export * from './components/ModalSheetView/ModalSheetViewTypes'; + +export * from './components/ModalSheetViewContent/ModalSheetViewMainContent'; +export * from './components/ModalSheetViewContent/ModalSheetViewContentTypes'; export * from './context/ModalSheetViewContext'; export * from './hooks/useModalSheetViewEvents';