Skip to content

Commit

Permalink
feat: expose default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakeoon committed Jul 26, 2022
1 parent 0bfd1a1 commit e541f37
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/babel/__fixtures__/rewrite-imports/code.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable prettier/prettier */

import { Text } from 'react-native';
import {
Provider as PaperProvider,
BottomNavigation,
Expand All @@ -13,5 +11,5 @@ import {
NonExistentSecond as Stuff,
ThemeProvider,
withTheme,
InternalTheme,
DefaultTheme,
} from 'react-native-paper';
4 changes: 2 additions & 2 deletions src/babel/__fixtures__/rewrite-imports/output.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable prettier/prettier */
import { Text } from 'react-native';
import PaperProvider from "react-native-paper/lib/module/core/Provider";
import BottomNavigation from "react-native-paper/lib/module/components/BottomNavigation/BottomNavigation";
import Button from "react-native-paper/lib/module/components/Button/Button";
import FAB from "react-native-paper/lib/module/components/FAB";
import Appbar from "react-native-paper/lib/module/components/Appbar";
import * as MD2Colors from "react-native-paper/lib/module/styles/themes/v2/colors";
import { MD3Colors } from "react-native-paper/lib/module/styles/themes/v3/tokens";
import { NonExistent, NonExistentSecond as Stuff, InternalTheme } from "react-native-paper/lib/module/index.js";
import { NonExistent, NonExistentSecond as Stuff } from "react-native-paper/lib/module/index.js";
import { ThemeProvider } from "react-native-paper/lib/module/core/theming";
import { withTheme } from "react-native-paper/lib/module/core/theming";
import { DefaultTheme } from "react-native-paper/lib/module/core/theming";
4 changes: 2 additions & 2 deletions src/core/theming.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
MD3LightTheme,
} from '../styles/themes';

const defaultTheme = MD3LightTheme;
export const DefaultTheme = MD3LightTheme;

export const { ThemeProvider, withTheme, useTheme } =
createTheming<ReactNativePaperTheme>(defaultTheme);
createTheming<ReactNativePaperTheme>(DefaultTheme);

export const useInternalTheme = (
themeOverrides?: $DeepPartial<InternalTheme>
Expand Down
7 changes: 6 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ export { MD2Colors };

export { MD3Colors } from './styles/themes/v3/tokens';

export { useTheme, withTheme, ThemeProvider } from './core/theming';
export {
useTheme,
withTheme,
ThemeProvider,
DefaultTheme,
} from './core/theming';

export * from './styles/themes';

Expand Down

0 comments on commit e541f37

Please sign in to comment.