Massive/MassiveFab.tsx
Brandon Presley 1a53fa324b Remove redundant Color context
Settings already stores the color set by the user.
2022-10-31 21:32:33 +13:00

28 lines
591 B
TypeScript

import {ComponentProps} from 'react'
import {FAB, useTheme} from 'react-native-paper'
import {lightColors} from './colors'
export default function MassiveFab(props: Partial<ComponentProps<typeof FAB>>) {
const {colors} = useTheme()
const fabColor = lightColors
.map(lightColor => lightColor.hex)
.includes(colors.primary)
? 'black'
: undefined
return (
<FAB
icon="add"
color={fabColor}
style={{
position: 'absolute',
right: 10,
bottom: 10,
backgroundColor: colors.primary,
}}
{...props}
/>
)
}