2022-10-14 04:24:02 +00:00
|
|
|
import React from 'react';
|
2022-07-15 06:06:33 +00:00
|
|
|
import {FAB} from 'react-native-paper';
|
2022-10-14 04:24:02 +00:00
|
|
|
import {useColor} from './color';
|
2022-09-25 04:32:49 +00:00
|
|
|
import {lightColors} from './colors';
|
2022-07-08 02:59:19 +00:00
|
|
|
|
|
|
|
export default function MassiveFab(
|
2022-07-15 06:06:33 +00:00
|
|
|
props: Partial<React.ComponentProps<typeof FAB>>,
|
2022-07-08 02:59:19 +00:00
|
|
|
) {
|
2022-10-14 04:24:02 +00:00
|
|
|
const {color} = useColor();
|
2022-09-25 04:32:49 +00:00
|
|
|
const fabColor = lightColors.map(lightColor => lightColor.hex).includes(color)
|
|
|
|
? 'black'
|
|
|
|
: undefined;
|
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',
|
|
|
|
right: 10,
|
2022-10-14 05:12:21 +00:00
|
|
|
bottom: 10,
|
2022-09-24 01:57:51 +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
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|