From aa2d146527d57ae3f7dbdcfc92404c8a22ee2a0b Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Wed, 2 Nov 2022 16:38:42 +1300 Subject: [PATCH] Fix color detection for MassiveFab --- MassiveFab.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MassiveFab.tsx b/MassiveFab.tsx index 38a3e74c..70248609 100644 --- a/MassiveFab.tsx +++ b/MassiveFab.tsx @@ -1,12 +1,13 @@ import {ComponentProps} from 'react' -import {FAB, useTheme} from 'react-native-paper' +import {FAB} from 'react-native-paper' import {CombinedDarkTheme, CombinedDefaultTheme} from './App' import {lightColors} from './colors' +import {useTheme} from './use-theme' export default function MassiveFab(props: Partial>) { - const {colors} = useTheme() + const {color} = useTheme() - const fabColor = lightColors.includes(colors.primary) + const fabColor = lightColors.includes(color) ? CombinedDarkTheme.colors.background : CombinedDefaultTheme.colors.background @@ -18,7 +19,7 @@ export default function MassiveFab(props: Partial>) { position: 'absolute', right: 10, bottom: 10, - backgroundColor: colors.primary, + backgroundColor: color, }} {...props} />