This commit is contained in:
MuslemRahimi 2025-02-04 17:44:13 +01:00
parent 439474c2f9
commit f9064c9519
6 changed files with 50 additions and 29 deletions

View File

@ -39,14 +39,16 @@
async function sendFeedback() {
if (inputValue?.length === 0) {
toast.error("Please enter your feedback", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
if (rating?.length === 0 && category === "general") {
toast.error("Please select an emoji", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
@ -72,7 +74,8 @@
});
toast.success("Thank you for your feedback", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
rating = "";

View File

@ -18,7 +18,7 @@
if (targetPrice < 0) {
toast.error(`Target Price must be above zero`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
} else {
const closePopup = document.getElementById("priceAlertModal");
@ -49,7 +49,7 @@
toast.success(`Successfully created price alert`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
targetPrice = currentPrice;
}
@ -224,7 +224,7 @@
>
<p class="text-sm sm:text-[1rem]">
Your price alert will notify you when the stock price is {condition}
{targetPrice?.toFixed(2)}.
{targetPrice}.
</p>
</div>
{/if}

View File

@ -85,7 +85,7 @@
if (numberOfChecked === 0) {
toast.error(`You need to select symbols before you can delete them`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
} else {
const postData = {

View File

@ -1507,7 +1507,8 @@
if (output === "success") {
toast.success("Strategy deleted successfully!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
strategyList =
@ -1544,7 +1545,8 @@
);
} else if (output === "failure") {
toast.error("Something went wrong. Please try again", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
}
@ -1560,14 +1562,16 @@
if (!title || title.length === 0) {
toast.error("Title cannot be empty!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
if (title?.length > 100) {
toast.error("Title is too long. Keep it simple and concise bruv!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
@ -1590,7 +1594,8 @@
const output = await response?.json();
if (output?.id && output?.id?.length !== 0) {
toast.success("Strategy created successfully!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
const closePopup = document.getElementById("addStrategy");
@ -1603,7 +1608,8 @@
selectedPopularStrategy = "";
} else {
toast.error("Something went wrong. Please try again later!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
@ -1718,7 +1724,8 @@
function handleAddRule() {
if (ruleName === "") {
toast.error("Please select a rule", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
@ -1926,7 +1933,8 @@ const handleKeyDown = (event) => {
if (printToast === true) {
toast.success("Strategy saved!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}

View File

@ -93,12 +93,12 @@
if (numberOfChecked === 0) {
toast.error(`You need to select symbols before you can delete them`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
} else if (data?.getOptionsWatchlist?.id?.length === 0) {
toast.error(`You need to select symbols before you can delete them`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
} else {
optionsWatchlist = optionsWatchlist?.filter(
@ -122,6 +122,7 @@
deleteOptionsId = [];
numberOfChecked = 0;
editMode = !editMode;
}
}

View File

@ -295,14 +295,16 @@
if (!title || title?.length === 0) {
toast.error("Title cannot be empty!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
if (title?.length > 100) {
toast.error("Title is too long. Keep it simple and concise bruv!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
return;
}
@ -334,7 +336,8 @@
}
toast.success("Watchlist created successfully!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
const clicked = document.getElementById("addWatchlist");
@ -344,13 +347,15 @@
anchor.dispatchEvent(new MouseEvent("click"));
} else {
toast.error("Something went wrong. Please try again!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
} catch (error) {
console.error("Error:", error);
toast.error("An error occurred. Please try again later.", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
}
@ -382,7 +387,8 @@
if (output === "success") {
toast.success("Watchlist deleted successfully!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
allList = allList?.filter((item) => item?.id !== displayWatchList?.id);
@ -395,13 +401,15 @@
clicked.dispatchEvent(new MouseEvent("click"));
} else {
toast.error("Something went wrong. Please try again!", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
} catch (error) {
console.error("Error:", error);
toast.error("An error occurred. Please try again later.", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
}
@ -433,7 +441,7 @@
if (numberOfChecked === 0) {
toast.error(`You need to select symbols before you can delete them`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
} else {
watchList = watchList?.filter(
@ -500,7 +508,7 @@
} else {
toast.error(`This symbol is already in your watchlist`, {
style:
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
inputValue = "";
@ -574,7 +582,8 @@
saveRules();
} else {
toast.error("Only for Pro Members", {
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
style:
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
});
}
}
@ -1856,7 +1865,7 @@
></label>
<!-- Desktop modal content -->
<div class="modal-box w-full bg-[#191919]">
<div class="modal-box w-full bg-secondary">
<div class="text-white mb-5">
<h3 class="font-bold text-2xl mb-5">New Watchlist</h3>