This commit is contained in:
MuslemRahimi 2024-12-14 21:57:38 +01:00
parent 3882116ab6
commit b8c0ac0846
22 changed files with 193 additions and 146 deletions

View File

@ -31,7 +31,7 @@
if (output?.message === "success") {
isClicked = true;
toast.success("Portfolio created successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
setTimeout(() => {
@ -58,7 +58,7 @@
}, 500);
} else {
toast.error("Something went wrong. Please try again.", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}

View File

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

View File

@ -19,19 +19,19 @@
case "redirect":
isClicked = true;
toast.success("Login successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Invalid credentials", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:
@ -63,19 +63,19 @@
case "redirect":
isClicked = true;
toast.success("Registration successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Invalid credentials", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:

View File

@ -88,7 +88,7 @@
if (output === "success") {
toast.success("Commented successfully", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
$commentAdded = newComment;
@ -100,7 +100,7 @@
handleCancel();
} else {
toast.error("Something went wrong. Please try again...", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}

View File

@ -18,7 +18,7 @@
if (targetPrice < 0) {
toast.error(`Target Price must be above zero`, {
style:
"border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
});
} else {
const closePopup = document.getElementById("priceAlertModal");
@ -49,12 +49,30 @@
toast.success(`Successfully created price alert`, {
style:
"border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
});
targetPrice = currentPrice;
}
}
async function stepSizeValue(condition) {
let step = 0.01;
if (targetPrice <= 2) {
step = 0.01;
} else if (targetPrice <= 5) {
step = 0.1;
} else if (targetPrice <= 100) {
step = 0.5;
} else if (targetPrice <= 200) {
step = 1;
}
targetPrice += condition === "add" ? step : -step;
// Round to 2 decimal places
targetPrice = parseFloat(targetPrice.toFixed(2));
}
$: {
if ($openPriceAlert === true) {
$openPriceAlert = false;
@ -151,44 +169,80 @@
<div class="flex flex-col sm:flex-row items-start sm:items-center">
<label class="text-sm w-[20%] mb-1 sm:mb-0">Value</label>
<input
type="number"
bind:value={targetPrice}
step="0.1"
class="w-full sm:w-[80%] bg-[#2A2E39] border border-gray-600 text-sm rounded-md py-2 px-3 text-white"
/>
<div class="relative w-full sm:w-[80%]">
<input
bind:value={targetPrice}
class="w-full bg-[#2A2E39] border border-gray-600 text-sm rounded-md py-2 px-3 pr-16 text-white"
/>
<div
class="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-x-1.5"
>
<button on:click={() => stepSizeValue("add")}>
<svg
class="size-6 cursor-pointer text-white"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
style="max-width: 40px"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
></path>
</svg>
</button>
<button on:click={() => stepSizeValue("minus")}>
<svg
class="size-6 cursor-pointer text-white"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
style="max-width: 40px"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
></path>
</svg>
</button>
</div>
</div>
</div>
</div>
{#if !isNaN(targetPrice) && targetPrice !== undefined && targetPrice !== null}
<div class="flex flex-col gap-2 mt-5 text-white">
<label class="text-sm sm:text-[1rem] font-semibold"
>Quick Summary:</label
{#if !isNaN(targetPrice) && targetPrice !== undefined && targetPrice !== null}
<div class="flex flex-col gap-2 mt-5 text-white">
<label class="text-sm sm:text-[1rem] font-semibold"
>Quick Summary:</label
>
<p class="text-sm sm:text-[1rem]">
Your price alert will notify you when the stock price is {condition}
{targetPrice?.toFixed(2)}.
</p>
</div>
{/if}
<!-- Action Buttons -->
<div class="flex justify-end gap-4 mt-6 absolute bottom-5 right-5">
<label
for="priceAlertModal"
class="cursor-pointer border border-gray-600 text-white py-2 px-4 rounded-md text-sm"
>
<p class="text-sm sm:text-[1rem]">
Your price alert will notify you when the stock price is {condition}
{targetPrice?.toFixed(2)}.
</p>
Cancel
</label>
<button
on:click={handleCreateAlert}
class="bg-white text-black py-2 px-4 rounded-md text-sm"
>
Save
</button>
</div>
{/if}
<!-- Action Buttons -->
<div class="flex justify-end gap-4 mt-6 absolute bottom-5 right-5">
<label
for="priceAlertModal"
class="cursor-pointer border border-gray-600 text-white py-2 px-4 rounded-md text-sm"
>
Cancel
</label>
<button
on:click={handleCreateAlert}
class="bg-white text-black py-2 px-4 rounded-md text-sm"
>
Save
</button>
</div>
</div>
<!--End Trade Modal-->
<!--End Trade Modal-->
</div>
</div>
</dialog>

View File

@ -1,41 +1,38 @@
<script lang="ts">
import toast from "svelte-french-toast";
<script lang='ts'>
import toast from 'svelte-french-toast';
export let url;
export let url;
function shareContent() {
if (navigator.share) {
navigator.share({
title: document.title,
url,
})
.then(() => console.log('Content shared successfully.'))
.catch((error) => console.log('Error sharing content:', error));
} else {
toast.error('Sharing is not supported by your device', {
style: 'background: #333; color: #fff;'
function shareContent() {
if (navigator.share) {
navigator
.share({
title: document.title,
url,
})
.then(() => console.log("Content shared successfully."))
.catch((error) => console.log("Error sharing content:", error));
} else {
toast.error("Sharing is not supported by your device", {
style: "background: #2A2E39; color: #fff;",
});
}
}
}
</script>
<label on:click={shareContent} class="lg:hidden cursor-pointer ml-auto mr-10">
<svg class="inline-block w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#d6d6dc" d="M18 22q-1.25 0-2.125-.875T15 19q0-.175.025-.363t.075-.337l-7.05-4.1q-.425.375-.95.588T6 15q-1.25 0-2.125-.875T3 12q0-1.25.875-2.125T6 9q.575 0 1.1.213t.95.587l7.05-4.1q-.05-.15-.075-.337T15 5q0-1.25.875-2.125T18 2q1.25 0 2.125.875T21 5q0 1.25-.875 2.125T18 8q-.575 0-1.1-.212t-.95-.588L8.9 11.3q.05.15.075.338T9 12q0 .175-.025.363T8.9 12.7l7.05 4.1q.425-.375.95-.587T18 16q1.25 0 2.125.875T21 19q0 1.25-.875 2.125T18 22Z"/></svg>
<svg
class="inline-block w-5 h-5 mr-3"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
><path
fill="#d6d6dc"
d="M18 22q-1.25 0-2.125-.875T15 19q0-.175.025-.363t.075-.337l-7.05-4.1q-.425.375-.95.588T6 15q-1.25 0-2.125-.875T3 12q0-1.25.875-2.125T6 9q.575 0 1.1.213t.95.587l7.05-4.1q-.05-.15-.075-.337T15 5q0-1.25.875-2.125T18 2q1.25 0 2.125.875T21 5q0 1.25-.875 2.125T18 8q-.575 0-1.1-.212t-.95-.588L8.9 11.3q.05.15.075.338T9 12q0 .175-.025.363T8.9 12.7l7.05 4.1q.425-.375.95-.587T18 16q1.25 0 2.125.875T21 19q0 1.25-.875 2.125T18 22Z"
/></svg
>
<!--
<span class="font-medium text-[#D6D6DC] text-sm">
Share
</span>
-->
</label>
</label>

View File

@ -94,7 +94,7 @@
}
} else {
toast.error("Only for Pro Members", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}

View File

@ -251,7 +251,7 @@
saveRules();
} else {
toast.error("Only for Pro Members", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}

View File

@ -54,7 +54,7 @@
.catch((error) => console.log("Error sharing content:", error));
} else {
toast.error("Sharing is not supported by your device", {
style: "background: #333; color: #fff;",
style: "background: #2A2E39; color: #fff;",
});
}
}

View File

@ -53,7 +53,7 @@
.catch((error) => console.log("Error sharing content:", error));
} else {
toast.error("Sharing is not supported by your device", {
style: "background: #333; color: #fff;",
style: "background: #2A2E39; color: #fff;",
});
}
}
@ -752,7 +752,7 @@
<dialog
id="addWatchListModal"
class="modal modal-bottom sm:modal-middle bg-[#000] bg-opacity-[0.5]"
class="modal bg-[#000] bg-opacity-[0.8] p-3 sm:p-0"
>
<label
id="addWatchListModal"
@ -760,12 +760,10 @@
class="cursor-pointer modal-backdrop"
></label>
<div
class="modal-box rounded-md w-full bg-[#1E222D] sm:border sm:border-gray-600"
>
<div class="modal-box rounded-md w-full bg-[#1E222D] border border-gray-600">
<label
for="addWatchListModal"
class="cursor-pointer bg-[#1E222D] absolute right-5 top-2 text-[1.8rem] text-white"
class="cursor-pointer bg-[#1E222D] absolute right-5 top-2 text-[1rem] sm:text-[1.8rem] text-white"
>
</label>

View File

@ -17,14 +17,14 @@
case "success":
if (form?.notVerified) {
toast.error("Please verify your email first", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
} else form?.notVerified === false;
{
toast.success("Login successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
@ -32,19 +32,19 @@
case "redirect":
isClicked = true;
toast.success("Login successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Invalid credentials", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:

View File

@ -232,7 +232,7 @@
function handleAddRule() {
if (ruleName === "") {
toast.error("Please select a rule", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
return;
}
@ -291,7 +291,7 @@
ruleOfList = [...ruleOfList, newRule];
/*
toast.success('Rule added', {
style: 'border-radius: 200px; background: #333; color: #fff;'
style: 'border-radius: 200px; background: #2A2E39; color: #fff;'
});
*/
@ -523,7 +523,7 @@
}
} else {
toast.error(`Market is closed`, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}
@ -782,7 +782,7 @@
}
} else {
toast.error("Only for Pro Members", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
};

View File

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

View File

@ -16,25 +16,25 @@
switch (result.type) {
case "success":
toast.success("Subscription Cancelled successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "redirect":
toast.success("Subscription Cancelled successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Something went wrong.", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:
@ -58,25 +58,25 @@
switch (result.type) {
case "success":
toast.success("Subscription Reactivate successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "redirect":
toast.success("Subscription Reactivate successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Something went wrong.", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:
@ -100,25 +100,25 @@
switch (result.type) {
case "success":
toast.success("Changing to Annual Plan successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "redirect":
toast.success("Changing to Annual Plan successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Something went wrong.", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:

View File

@ -18,19 +18,19 @@
case "redirect":
isClicked = true;
toast.success("Registration successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "failure":
toast.error("Invalid credentials", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
await update();
break;
case "error":
toast.error(result.error.message, {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
break;
default:

View File

@ -12,14 +12,14 @@
try {
await pb.collection("users").requestPasswordReset(email);
toast.success("Password resetted. Check your emails!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
goto("/login");
} catch (err) {
toast.error(
{ err },
{
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
},
);
}

View File

@ -1430,7 +1430,7 @@
if (output === "success") {
toast.success("Strategy deleted successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
strategyList =
@ -1466,7 +1466,7 @@
);
} else if (output === "failure") {
toast.error("Something went wrong. Please try again", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}
@ -1482,14 +1482,14 @@
if (!title || title.length === 0) {
toast.error("Title cannot be empty!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
return;
}
if (title?.length > 100) {
toast.error("Title is too long. Keep it simple and concise bruv!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
return;
}
@ -1512,7 +1512,7 @@
const output = await response?.json();
if (output?.id && output?.id?.length !== 0) {
toast.success("Strategy created successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
const closePopup = document.getElementById("addStrategy");
@ -1525,7 +1525,7 @@
selectedPopularStrategy = "";
} else {
toast.error("Something went wrong. Please try again later!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
@ -1617,7 +1617,7 @@
function handleAddRule() {
if (ruleName === "") {
toast.error("Please select a rule", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
return;
}
@ -1677,7 +1677,7 @@
ruleOfList = [...ruleOfList, newRule];
/*
toast.success('Rule added', {
style: 'border-radius: 200px; background: #333; color: #fff;'
style: 'border-radius: 200px; background: #2A2E39; color: #fff;'
});
*/
@ -1804,7 +1804,7 @@ const handleKeyDown = (event) => {
if (printToast === true) {
toast.success("Strategy saved!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}

View File

@ -61,7 +61,7 @@
?.catch((error) => console.log("Error sharing content:", error));
} else {
toast.error("Sharing is not supported by your device", {
style: "background: #333; color: #fff;",
style: "background: #2A2E39; color: #fff;",
});
}
}
@ -994,7 +994,7 @@
<dialog
id="addWatchListModal"
class="modal modal-bottom sm:modal-middle bg-[#000] bg-opacity-[0.5]"
class="modal bg-[#000] bg-opacity-[0.8] p-3 sm:p-0"
>
<label
id="addWatchListModal"
@ -1002,12 +1002,10 @@
class="cursor-pointer modal-backdrop"
></label>
<div
class="modal-box rounded-md w-full bg-[#1E222D] sm:border sm:border-gray-600"
>
<div class="modal-box rounded-md w-full bg-[#1E222D] border border-gray-600">
<label
for="addWatchListModal"
class="cursor-pointer bg-[#1E222D] absolute right-5 top-2 text-[1.8rem] text-white"
class="cursor-pointer bg-[#1E222D] absolute right-5 top-2 text-[1rem] sm:text-[1.8rem] text-white"
>
</label>

View File

@ -34,7 +34,7 @@ export const actions = {
error(err.status, err.message);
}
redirect(302, "/");
//redirect(302, "/");
},
register: async ({ locals, request }) => {
@ -75,7 +75,7 @@ await locals.pb?.collection('users').update(
error(err.status, err.message);
}
redirect(303, "/");
//redirect(303, "/");
},
oauth2: async ({ url, locals, request, cookies }) => {

View File

@ -32,7 +32,7 @@
const cleanedData = updatePasswordSchema.parse(postData);
await pb.collection("users").update(data?.user?.id, cleanedData);
toast.success("Password updated!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
} catch (error) {
if (error instanceof z.ZodError) {
@ -49,14 +49,14 @@
?.message ?? "";
toast.error("Invalid credentials", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
} else {
// Handle other errors
console.error("Unexpected error during registration:", error);
toast.error("An unexpected error occurred", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}

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: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
});
} else if (data?.getOptionsWatchlist?.id?.length === 0) {
toast.error(`You need to select symbols before you can delete them`, {
style:
"border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
});
} else {
optionsWatchlist = optionsWatchlist?.filter(

View File

@ -282,14 +282,14 @@
if (!title || title?.length === 0) {
toast.error("Title cannot be empty!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
return;
}
if (title?.length > 100) {
toast.error("Title is too long. Keep it simple and concise bruv!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
return;
}
@ -321,7 +321,7 @@
}
toast.success("Watchlist created successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
const clicked = document.getElementById("addWatchlist");
@ -331,13 +331,13 @@
anchor.dispatchEvent(new MouseEvent("click"));
} else {
toast.error("Something went wrong. Please try again!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
} catch (error) {
console.error("Error:", error);
toast.error("An error occurred. Please try again later.", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}
@ -369,7 +369,7 @@
if (output === "success") {
toast.success("Watchlist deleted successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
allList = allList?.filter((item) => item?.id !== displayWatchList?.id);
@ -382,13 +382,13 @@
clicked.dispatchEvent(new MouseEvent("click"));
} else {
toast.error("Something went wrong. Please try again!", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
} catch (error) {
console.error("Error:", error);
toast.error("An error occurred. Please try again later.", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}
@ -420,7 +420,7 @@
if (numberOfChecked === 0) {
toast.error(`You need to select symbols before you can delete them`, {
style:
"border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
});
} else {
watchList = watchList?.filter(
@ -487,7 +487,7 @@
} else {
toast.error(`This symbol is already in your watchlist`, {
style:
"border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
"border-radius: 10px; background: #2A2E39; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);",
});
inputValue = "";
@ -561,7 +561,7 @@
saveRules();
} else {
toast.error("Only for Pro Members", {
style: "border-radius: 200px; background: #333; color: #fff;",
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
});
}
}