Skip to content

Commit

Permalink
🛠 Refactor: Remove Barrel Exports in src/components
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Oct 2, 2024
1 parent 5928f29 commit fb21d5c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
14 changes: 8 additions & 6 deletions src/components/ModalSheetView/ModalSheetView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -29,7 +31,7 @@ export const ModalSheetView = React.forwardRef<
const [
currentModalSheetStateMetrics,
setCurrentModalSheetStateMetrics,
] = React.useState<RNIModalSheetStateMetrics>(MODAL_SHEET_STATE_METRICS_DEFAULT);
] = React.useState<RNIModalSheetStateMetrics>(DEFAULT_MODAL_SHEET_VIEW_METRICS);

const callbacksToInvokeOnNextRender = React.useRef<Array<() => void>>([]);
React.useEffect(() => {
Expand Down
3 changes: 0 additions & 3 deletions src/components/ModalSheetView/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/ModalSheetViewContent/index.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/context/ModalSheetViewContext.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit fb21d5c

Please sign in to comment.