project setup
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { View, Text } from "react-native";
|
||||
|
||||
interface MessageDisplayProps {
|
||||
message: string;
|
||||
type: "error" | "success";
|
||||
}
|
||||
|
||||
export const MessageDisplay = ({ message, type }: MessageDisplayProps) => {
|
||||
if (!message) return null;
|
||||
|
||||
const backgroundColor =
|
||||
type === "error" ? "rgba(255,0,0,0.1)" : "rgba(0,255,0,0.1)";
|
||||
|
||||
const textColor = type === "error" ? "#F83434" : "#22C927";
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
padding: 10,
|
||||
backgroundColor,
|
||||
borderRadius: 4,
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: textColor }}>{message}</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user