feat: cycle and module cards alerts

This commit is contained in:
anmolsinghbhatia 2023-04-28 14:57:32 +05:30
parent e4e1aa8b52
commit df4211e54f
6 changed files with 22 additions and 17 deletions

View File

@ -117,8 +117,8 @@ export const DeleteCycleModal: React.FC<TConfirmCycleDeletionProps> = ({
handleClose();
setToastAlert({
title: "Success",
type: "success",
title: "Success",
message: "Cycle deleted successfully",
});
})

View File

@ -62,8 +62,8 @@ export const CreateUpdateCycleModal: React.FC<CycleModalProps> = ({
setToastAlert({
type: "success",
title: "Success!",
message: "Cycle created successfully.",
title: "Success",
message: "Cycle created successfully",
});
})
.catch((err) => {
@ -115,8 +115,8 @@ export const CreateUpdateCycleModal: React.FC<CycleModalProps> = ({
setToastAlert({
type: "success",
title: "Success!",
message: "Cycle updated successfully.",
title: "Success",
message: "Cycle updated successfully",
});
})
.catch((err) => {

View File

@ -219,9 +219,9 @@ export const SingleCycleCard: React.FC<TSingleStatProps> = ({
`${originURL}/${workspaceSlug}/projects/${projectId}/cycles/${cycle.id}`
).then(() => {
setToastAlert({
type: "success",
title: "Link Copied!",
message: "Cycle link copied to clipboard.",
type: "info",
title: "Link Copied Successfully",
iconType: "copy",
});
});
};
@ -282,7 +282,7 @@ export const SingleCycleCard: React.FC<TSingleStatProps> = ({
</div>
</div>
<div className="flex items-center justify-between mt-4">
<div className="mt-4 flex items-center justify-between">
<div className="flex items-center gap-2.5">
{cycle.owned_by.avatar && cycle.owned_by.avatar !== "" ? (
<Image
@ -293,7 +293,7 @@ export const SingleCycleCard: React.FC<TSingleStatProps> = ({
alt={cycle.owned_by.first_name}
/>
) : (
<span className="flex h-5 w-5 items-center justify-center rounded-full bg-brand-base capitalize bg-brand-secondary">
<span className="bg-brand-secondary flex h-5 w-5 items-center justify-center rounded-full bg-brand-base capitalize">
{cycle.owned_by.first_name.charAt(0)}
</span>
)}

View File

@ -54,6 +54,11 @@ export const DeleteModuleModal: React.FC<Props> = ({ isOpen, setIsOpen, data })
.then(() => {
if (moduleId) router.push(`/${workspaceSlug}/projects/${data.project}/modules`);
handleClose();
setToastAlert({
type: "success",
title: "Success",
message: "Module deleted successfully",
});
})
.catch(() => {
setToastAlert({

View File

@ -57,8 +57,8 @@ export const CreateUpdateModuleModal: React.FC<Props> = ({ isOpen, setIsOpen, da
setToastAlert({
type: "success",
title: "Success!",
message: "Module created successfully.",
title: "Success",
message: "Module created successfully",
});
})
.catch(() => {
@ -88,8 +88,8 @@ export const CreateUpdateModuleModal: React.FC<Props> = ({ isOpen, setIsOpen, da
setToastAlert({
type: "success",
title: "Success!",
message: "Module updated successfully.",
title: "Success",
message: "Module updated successfully",
});
})
.catch(() => {

View File

@ -104,9 +104,9 @@ export const SingleModuleCard: React.FC<Props> = ({ module, handleEditModule })
`${originURL}/${workspaceSlug}/projects/${projectId}/modules/${module.id}`
).then(() => {
setToastAlert({
type: "success",
title: "Link Copied!",
message: "Module link copied to clipboard.",
type: "info",
title: "Link Copied Successfully",
iconType: "copy",
});
});
};