App reorganization
This commit is contained in:
@@ -3,10 +3,6 @@
|
||||
import { memo } from "react";
|
||||
import { AlertView } from "./Alert.view";
|
||||
import type { AlertProps } from "./Alert.types";
|
||||
import {
|
||||
normalizeAlertStatus,
|
||||
normalizeAlertType,
|
||||
} from "../../../../lib/propNormalization";
|
||||
|
||||
const AlertContainer = memo<AlertProps>(
|
||||
({
|
||||
@@ -19,9 +15,8 @@ const AlertContainer = memo<AlertProps>(
|
||||
onClose,
|
||||
className = "",
|
||||
}) => {
|
||||
// Normalize props to handle both PascalCase (Figma) and lowercase (codebase)
|
||||
const status = normalizeAlertStatus(statusProp);
|
||||
const type = normalizeAlertType(typeProp);
|
||||
const status = statusProp;
|
||||
const type = typeProp;
|
||||
// Determine background and border colors based on status and type
|
||||
const getStatusStyles = () => {
|
||||
switch (status) {
|
||||
|
||||
@@ -1,26 +1,16 @@
|
||||
export type AlertStatusValue =
|
||||
| "default"
|
||||
| "positive"
|
||||
| "warning"
|
||||
| "danger"
|
||||
| "Default"
|
||||
| "Positive"
|
||||
| "Warning"
|
||||
| "Danger";
|
||||
export type AlertStatusValue = "default" | "positive" | "warning" | "danger";
|
||||
|
||||
export type AlertTypeValue = "toast" | "banner" | "Toast" | "Banner";
|
||||
export type AlertTypeValue = "toast" | "banner";
|
||||
|
||||
export interface AlertProps {
|
||||
title: string;
|
||||
description?: string;
|
||||
/**
|
||||
* Alert status. Accepts both lowercase and PascalCase (case-insensitive).
|
||||
* Figma uses PascalCase, codebase uses lowercase - both are supported.
|
||||
* Alert status.
|
||||
*/
|
||||
status?: AlertStatusValue;
|
||||
/**
|
||||
* Alert type. Accepts both lowercase and PascalCase (case-insensitive).
|
||||
* Figma uses PascalCase, codebase uses lowercase - both are supported.
|
||||
* Alert type.
|
||||
*/
|
||||
type?: AlertTypeValue;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user