mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-19 18:23:27 +08:00
refactor: export types from the main entry instead of /types
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"extends": "../.eslintrc",
|
||||
|
||||
"settings": {
|
||||
"import/core-modules": [ "react-native-paper", "react-native-paper/types" ]
|
||||
"import/core-modules": [ "react-native-paper" ]
|
||||
},
|
||||
|
||||
"rules": {
|
||||
|
||||
@@ -7,12 +7,12 @@ import {
|
||||
Provider as PaperProvider,
|
||||
DarkTheme,
|
||||
DefaultTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import createReactContext from 'create-react-context';
|
||||
import { createDrawerNavigator } from 'react-navigation';
|
||||
import RootNavigator from './src/RootNavigator';
|
||||
import DrawerItems from './DrawerItems';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type State = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
TouchableRipple,
|
||||
Text,
|
||||
Colors,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -6,7 +6,6 @@ module.exports = {
|
||||
{
|
||||
alias: {
|
||||
'react-native-paper': '../src/index',
|
||||
'react-native-paper/types': '../types',
|
||||
'react-native-vector-icons': '@expo/vector-icons',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
Switch,
|
||||
Paragraph,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
navigation: any,
|
||||
|
||||
@@ -8,9 +8,9 @@ import {
|
||||
ScrollView,
|
||||
SafeAreaView,
|
||||
Dimensions,
|
||||
type Theme,
|
||||
} from 'react-native';
|
||||
import { Banner, withTheme, FAB } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, ScrollView, StyleSheet, Image } from 'react-native';
|
||||
import { Button, List, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { Button, List, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
Card,
|
||||
Button,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
Colors,
|
||||
TouchableRipple,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, ScrollView, StyleSheet, Image } from 'react-native';
|
||||
import { Chip, List, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { Chip, List, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Colors, Button, withTheme } from 'react-native-paper';
|
||||
import { Colors, Button, withTheme, type Theme } from 'react-native-paper';
|
||||
import {
|
||||
DialogWithCustomColors,
|
||||
DialogWithLoadingIndicator,
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
DialogWithRadioBtns,
|
||||
UndismissableDialog,
|
||||
} from './Dialogs';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type State = {
|
||||
visible1: boolean,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { FlatList } from 'react-native';
|
||||
import { Divider, List, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { Divider, List, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { FlatList } from 'react-native';
|
||||
import { List, Divider, withTheme } from 'react-native-paper';
|
||||
import { List, Divider, withTheme, type Theme } from 'react-native-paper';
|
||||
import AppbarExample from './AppbarExample';
|
||||
import BannerExample from './BannerExample';
|
||||
import BottomNavigationExample from './BottomNavigationExample';
|
||||
@@ -26,7 +26,6 @@ import SwitchExample from './SwitchExample';
|
||||
import TextExample from './TextExample';
|
||||
import TextInputExample from './TextInputExample';
|
||||
import TouchableRippleExample from './TouchableRippleExample';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Colors, FAB, Portal, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { Colors, FAB, Portal, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { IconButton, Colors, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { IconButton, Colors, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { ScrollView, StyleSheet } from 'react-native';
|
||||
import { List, Divider, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { List, Divider, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { ScrollView, StyleSheet, Image } from 'react-native';
|
||||
import { List, Divider, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { List, Divider, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { ProgressBar, Paragraph, Colors, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import {
|
||||
ProgressBar,
|
||||
Paragraph,
|
||||
Colors,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
Colors,
|
||||
TouchableRipple,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Colors, withTheme, RadioButton, Paragraph } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import {
|
||||
Colors,
|
||||
withTheme,
|
||||
RadioButton,
|
||||
Paragraph,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { Colors, Caption, Searchbar, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import {
|
||||
Colors,
|
||||
Caption,
|
||||
Searchbar,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
navigation: any,
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { Snackbar, Colors, withTheme, Button } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import {
|
||||
Snackbar,
|
||||
Colors,
|
||||
withTheme,
|
||||
Button,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { ScrollView, StyleSheet } from 'react-native';
|
||||
import { Text, Surface, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import { Text, Surface, withTheme, type Theme } from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
Colors,
|
||||
TouchableRipple,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
Subheading,
|
||||
Title,
|
||||
withTheme,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
View,
|
||||
ScrollView,
|
||||
KeyboardAvoidingView,
|
||||
type Theme,
|
||||
} from 'react-native';
|
||||
import { TextInput, HelperText, withTheme } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
/* @flow */
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { TouchableRipple, withTheme, Paragraph } from 'react-native-paper';
|
||||
import type { Theme } from 'react-native-paper/types';
|
||||
import {
|
||||
TouchableRipple,
|
||||
withTheme,
|
||||
Paragraph,
|
||||
type Theme,
|
||||
} from 'react-native-paper';
|
||||
|
||||
type Props = {
|
||||
theme: Theme,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/* @flow */
|
||||
|
||||
import * as Colors from './styles/colors';
|
||||
import type { Theme as _Theme } from './types';
|
||||
|
||||
export type Theme = _Theme;
|
||||
|
||||
export { Colors };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user