80 lines
1.8 KiB
TypeScript
80 lines
1.8 KiB
TypeScript
import { StyleSheet, ViewStyle } from "react-native";
|
|
import { FAB_WIDTH_SMALL } from "../../../App/common/constants/FabIconConstants";
|
|
|
|
const BASE_ROOT_STYLES: ViewStyle = {
|
|
position: "absolute",
|
|
bottom: 0,
|
|
right: 20,
|
|
};
|
|
|
|
const SMALL_FAB_ICON_ROOT_STYLES: ViewStyle = {
|
|
...BASE_ROOT_STYLES,
|
|
paddingBottom: 1,
|
|
paddingRight: 1,
|
|
backgroundColor: "#BED7FF",
|
|
};
|
|
|
|
const BASE_FAB_BUTTON_STYLES: ViewStyle = {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
};
|
|
|
|
const SMALL_FAB_BUTTON_STYLES: ViewStyle = {
|
|
...BASE_FAB_BUTTON_STYLES,
|
|
backgroundColor: "#EAF2FF",
|
|
borderColor: "#BED7FF",
|
|
borderWidth: 1,
|
|
shadowOffset: { width: 1, height: 5 },
|
|
shadowOpacity: 0,
|
|
shadowRadius: 0,
|
|
shadowColor: "#BED7FF",
|
|
elevation: 3,
|
|
};
|
|
|
|
const LARGE_FAB_BUTTON_STYLES: ViewStyle = {
|
|
...BASE_FAB_BUTTON_STYLES,
|
|
backgroundColor: "#0047D6",
|
|
};
|
|
|
|
export const createStyles = (fabWidth: number) => {
|
|
const fabHeight = fabWidth;
|
|
const fabBorderRadius = fabWidth / 2;
|
|
const isSmall = fabWidth === FAB_WIDTH_SMALL;
|
|
const buttonTitleHeight = isSmall ? 19 : 22;
|
|
|
|
return StyleSheet.create({
|
|
rootStyles: {
|
|
...(isSmall ? SMALL_FAB_ICON_ROOT_STYLES : BASE_ROOT_STYLES),
|
|
borderRadius: fabBorderRadius,
|
|
},
|
|
fabButtonStyles: {
|
|
...(isSmall ? SMALL_FAB_BUTTON_STYLES : LARGE_FAB_BUTTON_STYLES),
|
|
height: fabHeight,
|
|
borderRadius: fabBorderRadius,
|
|
},
|
|
lottie: {
|
|
height: fabHeight,
|
|
width: fabWidth,
|
|
},
|
|
topLottie: {
|
|
position: "absolute",
|
|
top: 0,
|
|
left: 0,
|
|
height: 16,
|
|
width: 16,
|
|
},
|
|
image: {
|
|
height: fabHeight,
|
|
width: fabWidth,
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
},
|
|
buttonTitle: {
|
|
height: buttonTitleHeight,
|
|
paddingRight: 16,
|
|
width: "auto",
|
|
},
|
|
});
|
|
};
|