Add feature
This commit is contained in:
38
frontend/src/app/components/alerts/Alert.jsx
Normal file
38
frontend/src/app/components/alerts/Alert.jsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import React, { useState } from "react";
|
||||
import styles from "./styles.module.css";
|
||||
import BoxedCheckIcon from "../icons/boxedCheck";
|
||||
const Alert = (props) => {
|
||||
const [hide, setHide] = useState(false);
|
||||
const handleHide = () => {
|
||||
setHide(true);
|
||||
setTimeout(() => {
|
||||
props.setTriggerAlert(false);
|
||||
}, 250);
|
||||
};
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div
|
||||
className={`${styles.alertContainer} ${hide ? styles.hide : styles.show}`}
|
||||
>
|
||||
<div className={styles.headers}>
|
||||
<div className={styles.iconContainer}>
|
||||
<BoxedCheckIcon />
|
||||
</div>
|
||||
<p>Create New Service</p>
|
||||
</div>
|
||||
<div className={styles.alertBody}>
|
||||
<p>
|
||||
You are about to add a new record. Please review the details before
|
||||
continuing. Do you want to proceed?
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.actionButtons}>
|
||||
<button onClick={handleHide}>Confirm</button>
|
||||
<button onClick={handleHide}>Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Alert;
|
||||
130
frontend/src/app/components/alerts/styles.module.css
Normal file
130
frontend/src/app/components/alerts/styles.module.css
Normal file
@@ -0,0 +1,130 @@
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #00000037;
|
||||
}
|
||||
.alertContainer {
|
||||
display: flex;
|
||||
width: 449px;
|
||||
padding: 24px 16px 16px 16px;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
border-radius: 14px;
|
||||
background: #21232f;
|
||||
animation-name: showAlert;
|
||||
animation-duration: 0.3s;
|
||||
}
|
||||
.show {
|
||||
animation-name: showAlert;
|
||||
animation-duration: 0.3s;
|
||||
}
|
||||
.hide {
|
||||
animation-name: hideAlert;
|
||||
animation-duration: 0.3s;
|
||||
}
|
||||
|
||||
@keyframes showAlert {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
75% {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
@keyframes hideAlert {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
75% {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
}
|
||||
.headers {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
align-self: stretch;
|
||||
}
|
||||
.iconContainer {
|
||||
display: flex;
|
||||
padding: 12px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
border-radius: 50%;
|
||||
background: #2e305f;
|
||||
}
|
||||
.headers > p {
|
||||
color: #fff;
|
||||
font-family: Inter;
|
||||
font-size: 20px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.5px;
|
||||
}
|
||||
.alertBody {
|
||||
display: flex;
|
||||
padding: 12px 0;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
align-self: stretch;
|
||||
}
|
||||
.body > p {
|
||||
color: #fff;
|
||||
font-family: Inter;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
}
|
||||
.actionButtons {
|
||||
display: flex;
|
||||
padding-top: 12px;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
gap: 10px;
|
||||
align-self: stretch;
|
||||
}
|
||||
.actionButtons > button {
|
||||
display: flex;
|
||||
height: 36px;
|
||||
padding: 8px 16px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex: 1 0 0;
|
||||
border-radius: 6px;
|
||||
border: 0.5px solid #8187ff;
|
||||
background: rgba(83, 89, 242, 0.25);
|
||||
color: #fff;
|
||||
font-family: Inter;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
.actionButtons > button:nth-child(2) {
|
||||
border-radius: 6px;
|
||||
border: 0.5px solid #4e537e;
|
||||
background-color: transparent;
|
||||
}
|
||||
Reference in New Issue
Block a user