From c67d69931859ca90454bde9c0ac60d95a251c1dc Mon Sep 17 00:00:00 2001 From: Damiano Plebani Date: Tue, 9 Apr 2024 18:24:32 +0200 Subject: [PATCH] Remove `GradientBottomActions` --- .../layout/GradientBottomActions.tsx | 140 ------------------ 1 file changed, 140 deletions(-) delete mode 100644 src/components/layout/GradientBottomActions.tsx diff --git a/src/components/layout/GradientBottomActions.tsx b/src/components/layout/GradientBottomActions.tsx deleted file mode 100644 index 04e75c61..00000000 --- a/src/components/layout/GradientBottomActions.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import * as React from "react"; -import { Easing, StyleProp, StyleSheet, View, ViewStyle } from "react-native"; -import { easeGradient } from "react-native-easing-gradient"; -import LinearGradient from "react-native-linear-gradient"; -import Animated from "react-native-reanimated"; -import { IOColors, IOSpacer, IOVisualCostants, hexToRgba } from "../../core"; -import { WithTestID } from "../../utils/types"; -import { - ButtonLink, - ButtonLinkProps, - ButtonSolid, - ButtonSolidProps -} from "../buttons"; -import { VSpacer } from "../spacer"; - -export type GradientBottomActions = WithTestID<{ - transitionAnimStyle: Animated.AnimateStyle>; - dimensions: GradientBottomActionsDimensions; - // Accepted components: ButtonSolid for the primaryAction, ButtonLink for the secondaryAction - primaryActionProps?: Omit; - secondaryActionProps?: ButtonLinkProps; - // Debug mode - debugMode?: boolean; -}>; - -type GradientBottomActionsDimensions = { - bottomMargin: number; - extraBottomMargin: number; - gradientAreaHeight: number; - spaceBetweenActions: IOSpacer; - safeBackgroundHeight: number; -}; - -// Background color should be app main background (both light and dark themes) -const HEADER_BG_COLOR: IOColors = "white"; - -const { colors, locations } = easeGradient({ - colorStops: { - 0: { color: hexToRgba(IOColors[HEADER_BG_COLOR], 0) }, - 1: { color: IOColors[HEADER_BG_COLOR] } - }, - easing: Easing.ease, - extraColorStopsPerTransition: 20 -}); - -const styles = StyleSheet.create({ - buttonContainer: { - paddingHorizontal: IOVisualCostants.appMarginDefault, - width: "100%", - flex: 1, - flexShrink: 0, - justifyContent: "flex-end" - }, - gradientContainer: { - ...StyleSheet.absoluteFillObject - }, - safeBackgroundBlock: { - position: "absolute", - bottom: 0, - left: 0, - right: 0, - backgroundColor: IOColors[HEADER_BG_COLOR] - } -}); - -export const GradientBottomActions = ({ - primaryActionProps: primaryAction, - secondaryActionProps: secondaryAction, - dimensions, - transitionAnimStyle, - debugMode, - testID -}: GradientBottomActions) => ( - - - {/* 100% opacity bg color fills at least 45% of the area */} - - - - - - - {primaryAction && ( - - )} - - {secondaryAction && ( - - - {} - - )} - - -); - -export default GradientBottomActions;