mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 04:45:19 +08:00
chore: sort imports automatically
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import { View, Text, Button } from 'react-native';
|
||||
import { render, fireEvent } from '@testing-library/react-native';
|
||||
import { NavigationContainer, ParamListBase } from '@react-navigation/native';
|
||||
import { fireEvent, render } from '@testing-library/react-native';
|
||||
import * as React from 'react';
|
||||
import { Button, Text, View } from 'react-native';
|
||||
|
||||
import { createDrawerNavigator, DrawerScreenProps } from '../index';
|
||||
|
||||
it('renders a drawer navigator with screens', async () => {
|
||||
|
||||
@@ -6,30 +6,28 @@ export { default as createDrawerNavigator } from './navigators/createDrawerNavig
|
||||
/**
|
||||
* Views
|
||||
*/
|
||||
export { default as DrawerView } from './views/DrawerView';
|
||||
export { default as DrawerItem } from './views/DrawerItem';
|
||||
export { default as DrawerItemList } from './views/DrawerItemList';
|
||||
export { default as DrawerContent } from './views/DrawerContent';
|
||||
export { default as DrawerContentScrollView } from './views/DrawerContentScrollView';
|
||||
export { default as DrawerItem } from './views/DrawerItem';
|
||||
export { default as DrawerItemList } from './views/DrawerItemList';
|
||||
export { default as DrawerToggleButton } from './views/DrawerToggleButton';
|
||||
export { default as DrawerView } from './views/DrawerView';
|
||||
|
||||
/**
|
||||
* Utilities
|
||||
*/
|
||||
export { default as DrawerGestureContext } from './utils/DrawerGestureContext';
|
||||
|
||||
export { default as DrawerProgressContext } from './utils/DrawerProgressContext';
|
||||
export { default as useDrawerProgress } from './utils/useDrawerProgress';
|
||||
|
||||
export { default as getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
|
||||
export { default as useDrawerProgress } from './utils/useDrawerProgress';
|
||||
export { default as useDrawerStatus } from './utils/useDrawerStatus';
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export type {
|
||||
DrawerContentComponentProps,
|
||||
DrawerNavigationOptions,
|
||||
DrawerNavigationProp,
|
||||
DrawerScreenProps,
|
||||
DrawerContentComponentProps,
|
||||
} from './types';
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
createNavigatorFactory,
|
||||
useNavigationBuilder,
|
||||
DefaultNavigatorOptions,
|
||||
DrawerNavigationState,
|
||||
DrawerRouterOptions,
|
||||
DrawerRouter,
|
||||
DrawerActionHelpers,
|
||||
DrawerNavigationState,
|
||||
DrawerRouter,
|
||||
DrawerRouterOptions,
|
||||
ParamListBase,
|
||||
useNavigationBuilder,
|
||||
} from '@react-navigation/native';
|
||||
import * as React from 'react';
|
||||
import warnOnce from 'warn-once';
|
||||
import DrawerView from '../views/DrawerView';
|
||||
|
||||
import type {
|
||||
DrawerNavigationOptions,
|
||||
DrawerNavigationConfig,
|
||||
DrawerNavigationEventMap,
|
||||
DrawerNavigationOptions,
|
||||
} from '../types';
|
||||
import DrawerView from '../views/DrawerView';
|
||||
|
||||
type Props = DefaultNavigatorOptions<
|
||||
ParamListBase,
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
||||
import type { HeaderOptions } from '@react-navigation/elements';
|
||||
import type {
|
||||
Descriptor,
|
||||
DrawerActionHelpers,
|
||||
DrawerNavigationState,
|
||||
NavigationHelpers,
|
||||
NavigationProp,
|
||||
ParamListBase,
|
||||
Route,
|
||||
RouteProp,
|
||||
} from '@react-navigation/native';
|
||||
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
||||
import type {
|
||||
PanGestureHandler,
|
||||
PanGestureHandlerProperties,
|
||||
} from 'react-native-gesture-handler';
|
||||
import type {
|
||||
Route,
|
||||
ParamListBase,
|
||||
NavigationProp,
|
||||
Descriptor,
|
||||
NavigationHelpers,
|
||||
DrawerNavigationState,
|
||||
DrawerActionHelpers,
|
||||
RouteProp,
|
||||
} from '@react-navigation/native';
|
||||
import type { HeaderOptions } from '@react-navigation/elements';
|
||||
|
||||
export type Scene = {
|
||||
route: Route<string>;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import type Animated from 'react-native-reanimated';
|
||||
|
||||
import DrawerProgressContext from './DrawerProgressContext';
|
||||
|
||||
export default function useDrawerProgress():
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import DrawerStatusContext from './DrawerStatusContext';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import DrawerItemList from './DrawerItemList';
|
||||
import DrawerContentScrollView from './DrawerContentScrollView';
|
||||
|
||||
import type { DrawerContentComponentProps } from '../types';
|
||||
import DrawerContentScrollView from './DrawerContentScrollView';
|
||||
import DrawerItemList from './DrawerItemList';
|
||||
|
||||
export default function DrawerContent({
|
||||
descriptors,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
ScrollViewProps,
|
||||
I18nManager,
|
||||
ScrollView,
|
||||
ScrollViewProps,
|
||||
StyleSheet,
|
||||
} from 'react-native';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
||||
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
||||
|
||||
type Props = ScrollViewProps & {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Text,
|
||||
View,
|
||||
StyleSheet,
|
||||
StyleProp,
|
||||
ViewStyle,
|
||||
TextStyle,
|
||||
Platform,
|
||||
} from 'react-native';
|
||||
import { PlatformPressable } from '@react-navigation/elements';
|
||||
import { Link, useTheme } from '@react-navigation/native';
|
||||
import Color from 'color';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Platform,
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TextStyle,
|
||||
View,
|
||||
ViewStyle,
|
||||
} from 'react-native';
|
||||
|
||||
type Props = {
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
CommonActions,
|
||||
DrawerActions,
|
||||
@@ -6,8 +5,10 @@ import {
|
||||
ParamListBase,
|
||||
useLinkBuilder,
|
||||
} from '@react-navigation/native';
|
||||
import * as React from 'react';
|
||||
|
||||
import type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';
|
||||
import DrawerItem from './DrawerItem';
|
||||
import type { DrawerNavigationHelpers, DrawerDescriptorMap } from '../types';
|
||||
|
||||
type Props = {
|
||||
state: DrawerNavigationState<ParamListBase>;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import { Image, Platform, StyleSheet } from 'react-native';
|
||||
import { PlatformPressable } from '@react-navigation/elements';
|
||||
import {
|
||||
useNavigation,
|
||||
DrawerActions,
|
||||
ParamListBase,
|
||||
useNavigation,
|
||||
} from '@react-navigation/native';
|
||||
import * as React from 'react';
|
||||
import { Image, Platform, StyleSheet } from 'react-native';
|
||||
|
||||
import type { DrawerNavigationProp } from '../types';
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -1,41 +1,42 @@
|
||||
import {
|
||||
getHeaderTitle,
|
||||
Header,
|
||||
SafeAreaProviderCompat,
|
||||
Screen,
|
||||
} from '@react-navigation/elements';
|
||||
import {
|
||||
DrawerActions,
|
||||
DrawerNavigationState,
|
||||
ParamListBase,
|
||||
useTheme,
|
||||
} from '@react-navigation/native';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
View,
|
||||
StyleSheet,
|
||||
BackHandler,
|
||||
I18nManager,
|
||||
Platform,
|
||||
BackHandler,
|
||||
StyleSheet,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
||||
import Animated from 'react-native-reanimated';
|
||||
import {
|
||||
DrawerNavigationState,
|
||||
DrawerActions,
|
||||
useTheme,
|
||||
ParamListBase,
|
||||
} from '@react-navigation/native';
|
||||
import {
|
||||
Header,
|
||||
Screen,
|
||||
SafeAreaProviderCompat,
|
||||
getHeaderTitle,
|
||||
} from '@react-navigation/elements';
|
||||
import { MaybeScreenContainer, MaybeScreen } from './ScreenFallback';
|
||||
import { GestureHandlerRootView } from './GestureHandler';
|
||||
import DrawerToggleButton from './DrawerToggleButton';
|
||||
import DrawerContent from './DrawerContent';
|
||||
import DrawerStatusContext from '../utils/DrawerStatusContext';
|
||||
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
||||
import getDrawerStatusFromState from '../utils/getDrawerStatusFromState';
|
||||
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
||||
|
||||
import type {
|
||||
DrawerContentComponentProps,
|
||||
DrawerDescriptorMap,
|
||||
DrawerHeaderProps,
|
||||
DrawerNavigationConfig,
|
||||
DrawerNavigationHelpers,
|
||||
DrawerContentComponentProps,
|
||||
DrawerHeaderProps,
|
||||
DrawerNavigationProp,
|
||||
DrawerProps,
|
||||
} from '../types';
|
||||
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
||||
import DrawerStatusContext from '../utils/DrawerStatusContext';
|
||||
import getDrawerStatusFromState from '../utils/getDrawerStatusFromState';
|
||||
import DrawerContent from './DrawerContent';
|
||||
import DrawerToggleButton from './DrawerToggleButton';
|
||||
import { GestureHandlerRootView } from './GestureHandler';
|
||||
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
|
||||
|
||||
type Props = DrawerNavigationConfig & {
|
||||
state: DrawerNavigationState<ParamListBase>;
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
PanGestureHandler as PanGestureHandlerNative,
|
||||
PanGestureHandlerProperties,
|
||||
} from 'react-native-gesture-handler';
|
||||
|
||||
import DrawerGestureContext from '../utils/DrawerGestureContext';
|
||||
|
||||
export function PanGestureHandler(props: PanGestureHandlerProperties) {
|
||||
@@ -17,7 +18,7 @@ export function PanGestureHandler(props: PanGestureHandlerProperties) {
|
||||
|
||||
export {
|
||||
GestureHandlerRootView,
|
||||
TapGestureHandler,
|
||||
State as GestureState,
|
||||
PanGestureHandlerGestureEvent,
|
||||
TapGestureHandler,
|
||||
} from 'react-native-gesture-handler';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ResourceSavingView } from '@react-navigation/elements';
|
||||
import * as React from 'react';
|
||||
import { StyleProp, View, ViewProps, ViewStyle } from 'react-native';
|
||||
import { ResourceSavingView } from '@react-navigation/elements';
|
||||
|
||||
type Props = {
|
||||
visible: boolean;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
StyleSheet,
|
||||
LayoutChangeEvent,
|
||||
I18nManager,
|
||||
Platform,
|
||||
Keyboard,
|
||||
StatusBar,
|
||||
View,
|
||||
InteractionManager,
|
||||
Keyboard,
|
||||
LayoutChangeEvent,
|
||||
Platform,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import Animated from 'react-native-reanimated';
|
||||
import { PanGestureHandler, GestureState } from '../GestureHandler';
|
||||
import Overlay from './Overlay';
|
||||
import DrawerProgressContext from '../../utils/DrawerProgressContext';
|
||||
|
||||
import type { DrawerProps } from '../../types';
|
||||
import DrawerProgressContext from '../../utils/DrawerProgressContext';
|
||||
import { GestureState, PanGestureHandler } from '../GestureHandler';
|
||||
import Overlay from './Overlay';
|
||||
|
||||
const {
|
||||
Clock,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { Pressable, Platform, StyleSheet } from 'react-native';
|
||||
import { Platform, Pressable, StyleSheet } from 'react-native';
|
||||
import Animated from 'react-native-reanimated';
|
||||
|
||||
const {
|
||||
|
||||
@@ -21,6 +21,7 @@ import Animated, {
|
||||
useSharedValue,
|
||||
withSpring,
|
||||
} from 'react-native-reanimated';
|
||||
|
||||
import type { DrawerProps } from '../../types';
|
||||
import DrawerProgressContext from '../../utils/DrawerProgressContext';
|
||||
import Overlay from './Overlay';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { Pressable, Platform, StyleSheet } from 'react-native';
|
||||
import { Platform, Pressable, StyleSheet } from 'react-native';
|
||||
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
|
||||
|
||||
const PROGRESS_EPSILON = 0.05;
|
||||
|
||||
Reference in New Issue
Block a user