Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating component alert #38

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/components/alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useCallback } from "react";
import {
GestureResponderEvent,
Pressable,
StyleSheet,
View,
Text
Text,
View
} from "react-native";
import React, { useCallback } from "react";
import Animated, {
Extrapolate,
interpolate,
Expand All @@ -14,21 +14,21 @@ import Animated, {
useSharedValue,
withSpring
} from "react-native-reanimated";
import { Label } from "../typography/Label";
import { IOScaleValues, IOSpringValues } from "../../core/IOAnimations";
import {
IOColors,
IOColorsStatusBackground,
IOColorsStatusForeground
} from "../../core/IOColors";
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
import { HSpacer, VSpacer } from "../spacer";
import { IOStyles } from "../../core/IOStyles";
import { IOAlertRadius } from "../../core/IOShapes";
import { IOAlertSpacing } from "../../core/IOSpacing";
import { H4 } from "../typography/H4";
import { IOScaleValues, IOSpringValues } from "../../core/IOAnimations";
import { IOStyles } from "../../core/IOStyles";
import { makeFontStyleObject } from "../../utils/fonts";
import { WithTestID } from "../../utils/types";
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
import { HSpacer, VSpacer } from "../spacer";
import { H4 } from "../typography/H4";
import { Label } from "../typography/Label";

const iconSize: IOIconSizeScale = 24;

Expand Down Expand Up @@ -73,7 +73,7 @@ type AlertActionProps =
onPress?: never;
};

export type Alert = AlertProps & AlertActionProps;
type AlertType = AlertProps & AlertActionProps;

type VariantStates = {
icon: IOIcons;
Expand All @@ -83,7 +83,7 @@ type VariantStates = {

// COMPONENT CONFIGURATION

const mapVariantStates: Record<NonNullable<Alert["variant"]>, VariantStates> = {
const mapVariantStates: Record<NonNullable<AlertType["variant"]>, VariantStates> = {
error: {
icon: "errorFilled",
background: "error-100",
Expand Down Expand Up @@ -116,7 +116,7 @@ export const Alert = ({
fullWidth = false,
accessibilityHint,
testID
}: Alert) => {
}: AlertType): JSX.Element => {
const isPressed: Animated.SharedValue<number> = useSharedValue(0);

// Scaling transformation applied when the button is pressed
Expand Down