-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* delete app UI * Add toast for delete messages
- Loading branch information
Showing
8 changed files
with
192 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
</head> | ||
<body> | ||
<div id="root"></div> | ||
<div id="snackbar"></div> | ||
</body> | ||
<script | ||
type="module" | ||
|
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,12 @@ | ||
const DeleteIcon = (props) => { | ||
const id = props?.id || ""; | ||
const color = props?.color || ""; | ||
const className = props?.class || ""; | ||
const size = props?.size || "md"; | ||
return /*html*/ `<svg id="${id}" class="icon-${color} ${className} icon-size-${size}" viewBox="0 0 10 14" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M2.75381 13.5861C2.38405 13.5861 2.06832 13.4552 1.80662 13.1935C1.54492 12.9318 1.41406 12.6161 1.41406 12.2463V2.50277H0.414062V1.41946H3.99738V0.515625H7.99738V1.41946H11.5807V2.50277H10.5807V12.2373C10.5807 12.6226 10.4512 12.9437 10.1921 13.2007C9.93312 13.4576 9.61605 13.5861 9.24094 13.5861H2.75381ZM9.49738 2.50277H2.49738V12.2463C2.49738 12.3211 2.52142 12.3826 2.5695 12.4306C2.61758 12.4787 2.67902 12.5028 2.75381 12.5028H9.24094C9.30505 12.5028 9.36382 12.4761 9.41725 12.4226C9.47067 12.3692 9.49738 12.3104 9.49738 12.2463V2.50277ZM4.33394 11.0028H5.41725V4.00277H4.33394V11.0028ZM6.5775 11.0028H7.66081V4.00277H6.5775V11.0028Z"/> | ||
</svg> | ||
`; | ||
}; | ||
|
||
export default DeleteIcon; |
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,11 @@ | ||
const DELETE_METHOD = { method: "DELETE" }; | ||
|
||
export const DELETE_APP = async (apiEndpoint) => { | ||
var url = window.location.origin + apiEndpoint; | ||
const data = fetch(url, DELETE_METHOD) | ||
.then((res) => { | ||
return res; | ||
}) | ||
.catch((error) => console.log(error)); | ||
return data; | ||
}; |
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,9 @@ | ||
export const showSnackbar = (message, callback, timeout = 2000) => { | ||
let snackbar = document.getElementById("snackbar"); | ||
snackbar.innerHTML = message; | ||
snackbar.className = "show"; | ||
setTimeout(function () { | ||
snackbar.className = snackbar.className.replace("show", ""); | ||
callback(); | ||
}, timeout); | ||
}; |
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