From 1ee6374b3e7232189688f54fa74d651e7dfaf786 Mon Sep 17 00:00:00 2001 From: ektaghag-eaton Date: Wed, 20 Dec 2023 11:55:32 +0530 Subject: [PATCH 1/3] update readme with useExtendedTheme hook --- README.md | 52 ++++++++-------------------------------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index aa6fc9e..d04e256 100644 --- a/README.md +++ b/README.md @@ -65,54 +65,18 @@ In order for these components to look correct in your application, you should us ### TypeScript -Our Brightlayer UI themes extend the themes provided by React Native Paper. If you are using these themes in a TypeScript project and want to access any of the properties that were added to the defaults, you need to add the following [global augmentation](https://callstack.github.io/react-native-paper/theming.html#typescript) in your project's index.tsx file: +Our Brightlayer UI themes extend the themes provided by React Native Paper. If you are using these themes in a TypeScript project and want to access any of the properties that were added to the defaults, you need to use useExtendedTheme() hook in your project: ```tsx -declare global { - namespace ReactNativePaper { - interface ThemeColors { - primaryPalette: { - light: string; - main: string; - dark: string; - }; - accentPalette: { - light: string; - main: string; - dark: string; - }; - errorPalette: { - light: string; - main: string; - dark: string; - }; - divider: string; - textPalette: { - primary: string; - secondary: string; - onPrimary: { - light: string; - main: string; - dark: string; - }; - disabled: string; - }; - actionPalette: { - active: string; - background: string; - disabled: string; - disabledBackground: string; - }; - overrides: $DeepPartial; - opacity: Partial; - } - interface ThemeFonts { - bold: ThemeFont; - } - } -} +import { useExtendedTheme } from '@brightlayer-ui/react-native-themes'; +... +theme = useExtendedTheme(); + ``` + +--> \ No newline at end of file From ee97064525b5091234f09925c6ba97f3b26651e4 Mon Sep 17 00:00:00 2001 From: ektaghag-eaton Date: Wed, 3 Jan 2024 17:50:16 +0530 Subject: [PATCH 3/3] update example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14c81e7..ebcb0e6 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Our Brightlayer UI themes extend the themes provided by React Native Paper. If y ```tsx import { useExtendedTheme } from '@brightlayer-ui/react-native-themes'; ... -theme = useExtendedTheme(); +const theme = useExtendedTheme();