generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from the-collab-lab/sc-issue-22
Sc issue 22
- Loading branch information
Showing
15 changed files
with
527 additions
and
193 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Svg from './Svg'; | ||
|
||
const ConfirmToast = ({ | ||
id, | ||
message, | ||
iconName, | ||
color, | ||
onConfirm, | ||
onCancel, | ||
}) => { | ||
// Render the toast only if the message is not empty | ||
if (!message) { | ||
return null; | ||
} | ||
return ( | ||
<div className="fixed inset-0 flex items-center justify-center z-50 backdrop-brightness-50"> | ||
<div | ||
id={id} | ||
className={`w-full max-w-md my-2 py-8 px-4 mb-3 text-gray-500 bg-white rounded-lg shadow-xl border border-gray-100`} | ||
role="alert" | ||
> | ||
<div className="flex items-center"> | ||
<div | ||
className={`inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-${color}-500 bg-${color}-100 rounded-lg`} | ||
> | ||
<Svg className="w-4 h-4" aria-hidden="true" symbolId={iconName} /> | ||
<span className="sr-only">{iconName} icon</span> | ||
</div> | ||
<div className="ms-3 text-sm font-normal"> | ||
<span className="text-sm font-semibold text-gray-900"> | ||
{message} | ||
</span> | ||
<div className="my-2 text-sm font-normal"> | ||
This action is forever-eva-eva. | ||
</div> | ||
<div className="mt-[20px] flex w-full"> | ||
<button | ||
type="button" | ||
onClick={onCancel} | ||
className="mr-[10px] w-full border-1 border-gray-200 rounded-md px-4 py-[12px]" | ||
> | ||
Cancel | ||
</button> | ||
<button | ||
onClick={onConfirm} | ||
className="rounded-md w-full px-4 py-[12px] text-white bg-red-700" | ||
> | ||
Delete | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConfirmToast; |
Oops, something went wrong.