tsx to jsx and components to Components
This commit is contained in:
1 parent
fb9318fd74
commit
7888205375
24 files changed
+1248
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import "./complexAlert.css";
|
||||
import React from "react";
|
||||
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* @param {Object} props
|
||||
* @param {"red" | "green"} props.theme - The color theme for the alert (required) - must be either "red" or "green"
|
||||
* @returns {JSX.Element} - Renders the complex alert component with dynamic color theme
|
||||
*/
|
||||
const ComplexAlert = ({ theme }) => {
|
||||
if (theme === "red") {
|
||||
return (
|
||||
<div className="icon-holder-outer-red">
|
||||
<div className="icon-holder-inner-red">
|
||||
<ErrorOutlineIcon className="icon-core" style={{ fill: "#D92D20" }} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} else if (theme === "green") {
|
||||
return (
|
||||
<div className="icon-holder-outer-green">
|
||||
<div className="icon-holder-inner-green">
|
||||
<ErrorOutlineIcon className="icon-core" style={{ fill: "#079455" }} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
ComplexAlert.propTypes = {
|
||||
theme: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default ComplexAlert;
|
||||
@@ -0,0 +1,44 @@
|
||||
.icon-holder-outer-red {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #d92d2019;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-holder-inner-red {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #d92d204d;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-holder-outer-green {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #07945519;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-holder-inner-green {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #0794554d;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-core {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
Reference in new issue
Block a user