2022-10-31 04:22:08 +00:00
|
|
|
import {ComponentProps} from 'react'
|
2022-11-02 03:38:42 +00:00
|
|
|
import {FAB} from 'react-native-paper'
|
2022-11-01 23:26:46 +00:00
|
|
|
import {CombinedDarkTheme, CombinedDefaultTheme} from './App'
|
2022-10-31 04:22:08 +00:00
|
|
|
import {lightColors} from './colors'
|
2022-11-02 03:38:42 +00:00
|
|
|
import {useTheme} from './use-theme'
|
2022-07-08 02:59:19 +00:00
|
|
|
|
2022-10-28 05:36:47 +00:00
|
|
|
export default function MassiveFab(props: Partial<ComponentProps<typeof FAB>>) {
|
2022-11-02 03:38:42 +00:00
|
|
|
const {color} = useTheme()
|
2022-10-31 08:32:33 +00:00
|
|
|
|
2022-11-02 03:38:42 +00:00
|
|
|
const fabColor = lightColors.includes(color)
|
2022-11-01 23:26:46 +00:00
|
|
|
? CombinedDarkTheme.colors.background
|
|
|
|
: CombinedDefaultTheme.colors.background
|
2022-07-15 06:06:33 +00:00
|
|
|
|
2022-07-08 02:59:19 +00:00
|
|
|
return (
|
2022-07-15 06:06:33 +00:00
|
|
|
<FAB
|
2022-07-08 02:59:19 +00:00
|
|
|
icon="add"
|
2022-09-25 04:32:49 +00:00
|
|
|
color={fabColor}
|
2022-07-15 06:06:33 +00:00
|
|
|
style={{
|
|
|
|
position: 'absolute',
|
2022-11-15 06:51:15 +00:00
|
|
|
right: 20,
|
|
|
|
bottom: 20,
|
2022-11-02 03:38:42 +00:00
|
|
|
backgroundColor: color,
|
2022-07-15 06:06:33 +00:00
|
|
|
}}
|
2022-09-26 01:38:25 +00:00
|
|
|
{...props}
|
2022-07-08 02:59:19 +00:00
|
|
|
/>
|
2022-10-31 04:22:08 +00:00
|
|
|
)
|
2022-07-08 02:59:19 +00:00
|
|
|
}
|