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") { if (output?.message === "success") {
isClicked = true; isClicked = true;
toast.success("Portfolio created successfully!", { toast.success("Portfolio created successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
setTimeout(() => { setTimeout(() => {
@ -58,7 +58,7 @@
}, 500); }, 500);
} else { } else {
toast.error("Something went wrong. Please try again.", { 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() { async function sendFeedback() {
if (inputValue?.length === 0) { if (inputValue?.length === 0) {
toast.error("Please enter your feedback", { toast.error("Please enter your feedback", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
return; return;
} }
if (rating?.length === 0 && category === "general") { if (rating?.length === 0 && category === "general") {
toast.error("Please select an emoji", { toast.error("Please select an emoji", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
return; return;
} }
@ -72,7 +72,7 @@
}); });
toast.success("Thank you for your feedback", { toast.success("Thank you for your feedback", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
rating = ""; rating = "";

View File

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

View File

@ -88,7 +88,7 @@
if (output === "success") { if (output === "success") {
toast.success("Commented successfully", { toast.success("Commented successfully", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
$commentAdded = newComment; $commentAdded = newComment;
@ -100,7 +100,7 @@
handleCancel(); handleCancel();
} else { } else {
toast.error("Something went wrong. Please try again...", { 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) { if (targetPrice < 0) {
toast.error(`Target Price must be above zero`, { toast.error(`Target Price must be above zero`, {
style: 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 { } else {
const closePopup = document.getElementById("priceAlertModal"); const closePopup = document.getElementById("priceAlertModal");
@ -49,12 +49,30 @@
toast.success(`Successfully created price alert`, { toast.success(`Successfully created price alert`, {
style: 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; 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) { if ($openPriceAlert === true) {
$openPriceAlert = false; $openPriceAlert = false;
@ -151,44 +169,80 @@
<div class="flex flex-col sm:flex-row items-start sm:items-center"> <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> <label class="text-sm w-[20%] mb-1 sm:mb-0">Value</label>
<input <div class="relative w-full sm:w-[80%]">
type="number" <input
bind:value={targetPrice} bind:value={targetPrice}
step="0.1" class="w-full bg-[#2A2E39] border border-gray-600 text-sm rounded-md py-2 px-3 pr-16 text-white"
class="w-full sm:w-[80%] bg-[#2A2E39] border border-gray-600 text-sm rounded-md py-2 px-3 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>
</div>
{#if !isNaN(targetPrice) && targetPrice !== undefined && targetPrice !== null} {#if !isNaN(targetPrice) && targetPrice !== undefined && targetPrice !== null}
<div class="flex flex-col gap-2 mt-5 text-white"> <div class="flex flex-col gap-2 mt-5 text-white">
<label class="text-sm sm:text-[1rem] font-semibold" <label class="text-sm sm:text-[1rem] font-semibold"
>Quick Summary:</label >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]"> Cancel
Your price alert will notify you when the stock price is {condition} </label>
{targetPrice?.toFixed(2)}. <button
</p> on:click={handleCreateAlert}
class="bg-white text-black py-2 px-4 rounded-md text-sm"
>
Save
</button>
</div> </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>
</div>
<!--End Trade Modal--> <!--End Trade Modal-->
</div>
</div> </div>
</dialog> </dialog>

View File

@ -1,41 +1,38 @@
<script lang="ts">
import toast from "svelte-french-toast";
<script lang='ts'> export let url;
import toast from 'svelte-french-toast';
function shareContent() {
export let url; if (navigator.share) {
navigator
.share({
title: document.title,
function shareContent() { url,
})
.then(() => console.log("Content shared successfully."))
.catch((error) => console.log("Error sharing content:", error));
if (navigator.share) { } else {
navigator.share({ toast.error("Sharing is not supported by your device", {
title: document.title, style: "background: #2A2E39; color: #fff;",
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;'
}); });
}
} }
}
</script> </script>
<label on:click={shareContent} class="lg:hidden cursor-pointer ml-auto mr-10"> <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"> <span class="font-medium text-[#D6D6DC] text-sm">
Share Share
</span> </span>
--> -->
</label> </label>

View File

@ -94,7 +94,7 @@
} }
} else { } else {
toast.error("Only for Pro Members", { 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(); saveRules();
} else { } else {
toast.error("Only for Pro Members", { 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)); .catch((error) => console.log("Error sharing content:", error));
} else { } else {
toast.error("Sharing is not supported by your device", { 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)); .catch((error) => console.log("Error sharing content:", error));
} else { } else {
toast.error("Sharing is not supported by your device", { toast.error("Sharing is not supported by your device", {
style: "background: #333; color: #fff;", style: "background: #2A2E39; color: #fff;",
}); });
} }
} }
@ -752,7 +752,7 @@
<dialog <dialog
id="addWatchListModal" 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 <label
id="addWatchListModal" id="addWatchListModal"
@ -760,12 +760,10 @@
class="cursor-pointer modal-backdrop" class="cursor-pointer modal-backdrop"
></label> ></label>
<div <div class="modal-box rounded-md w-full bg-[#1E222D] border border-gray-600">
class="modal-box rounded-md w-full bg-[#1E222D] sm:border sm:border-gray-600"
>
<label <label
for="addWatchListModal" 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> </label>

View File

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

View File

@ -232,7 +232,7 @@
function handleAddRule() { function handleAddRule() {
if (ruleName === "") { if (ruleName === "") {
toast.error("Please select a rule", { toast.error("Please select a rule", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
return; return;
} }
@ -291,7 +291,7 @@
ruleOfList = [...ruleOfList, newRule]; ruleOfList = [...ruleOfList, newRule];
/* /*
toast.success('Rule added', { 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 { } else {
toast.error(`Market is closed`, { 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 { } else {
toast.error("Only for Pro Members", { 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) { if (numberOfChecked === 0) {
toast.error(`You need to select symbols before you can delete them`, { toast.error(`You need to select symbols before you can delete them`, {
style: 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 { } else {
const postData = { const postData = {

View File

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

View File

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

View File

@ -12,14 +12,14 @@
try { try {
await pb.collection("users").requestPasswordReset(email); await pb.collection("users").requestPasswordReset(email);
toast.success("Password resetted. Check your emails!", { 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"); goto("/login");
} catch (err) { } catch (err) {
toast.error( toast.error(
{ err }, { 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") { if (output === "success") {
toast.success("Strategy deleted successfully!", { toast.success("Strategy deleted successfully!", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
strategyList = strategyList =
@ -1466,7 +1466,7 @@
); );
} else if (output === "failure") { } else if (output === "failure") {
toast.error("Something went wrong. Please try again", { 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) { if (!title || title.length === 0) {
toast.error("Title cannot be empty!", { toast.error("Title cannot be empty!", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
return; return;
} }
if (title?.length > 100) { if (title?.length > 100) {
toast.error("Title is too long. Keep it simple and concise bruv!", { 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; return;
} }
@ -1512,7 +1512,7 @@
const output = await response?.json(); const output = await response?.json();
if (output?.id && output?.id?.length !== 0) { if (output?.id && output?.id?.length !== 0) {
toast.success("Strategy created successfully!", { 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"); const closePopup = document.getElementById("addStrategy");
@ -1525,7 +1525,7 @@
selectedPopularStrategy = ""; selectedPopularStrategy = "";
} else { } else {
toast.error("Something went wrong. Please try again later!", { 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() { function handleAddRule() {
if (ruleName === "") { if (ruleName === "") {
toast.error("Please select a rule", { toast.error("Please select a rule", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
return; return;
} }
@ -1677,7 +1677,7 @@
ruleOfList = [...ruleOfList, newRule]; ruleOfList = [...ruleOfList, newRule];
/* /*
toast.success('Rule added', { 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) { if (printToast === true) {
toast.success("Strategy saved!", { 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)); ?.catch((error) => console.log("Error sharing content:", error));
} else { } else {
toast.error("Sharing is not supported by your device", { toast.error("Sharing is not supported by your device", {
style: "background: #333; color: #fff;", style: "background: #2A2E39; color: #fff;",
}); });
} }
} }
@ -994,7 +994,7 @@
<dialog <dialog
id="addWatchListModal" 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 <label
id="addWatchListModal" id="addWatchListModal"
@ -1002,12 +1002,10 @@
class="cursor-pointer modal-backdrop" class="cursor-pointer modal-backdrop"
></label> ></label>
<div <div class="modal-box rounded-md w-full bg-[#1E222D] border border-gray-600">
class="modal-box rounded-md w-full bg-[#1E222D] sm:border sm:border-gray-600"
>
<label <label
for="addWatchListModal" 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> </label>

View File

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

View File

@ -32,7 +32,7 @@
const cleanedData = updatePasswordSchema.parse(postData); const cleanedData = updatePasswordSchema.parse(postData);
await pb.collection("users").update(data?.user?.id, cleanedData); await pb.collection("users").update(data?.user?.id, cleanedData);
toast.success("Password updated!", { toast.success("Password updated!", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
} catch (error) { } catch (error) {
if (error instanceof z.ZodError) { if (error instanceof z.ZodError) {
@ -49,14 +49,14 @@
?.message ?? ""; ?.message ?? "";
toast.error("Invalid credentials", { toast.error("Invalid credentials", {
style: "border-radius: 200px; background: #333; color: #fff;", style: "border-radius: 200px; background: #2A2E39; color: #fff;",
}); });
} else { } else {
// Handle other errors // Handle other errors
console.error("Unexpected error during registration:", error); console.error("Unexpected error during registration:", error);
toast.error("An unexpected error occurred", { 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) { if (numberOfChecked === 0) {
toast.error(`You need to select symbols before you can delete them`, { toast.error(`You need to select symbols before you can delete them`, {
style: 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) { } else if (data?.getOptionsWatchlist?.id?.length === 0) {
toast.error(`You need to select symbols before you can delete them`, { toast.error(`You need to select symbols before you can delete them`, {
style: 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 { } else {
optionsWatchlist = optionsWatchlist?.filter( optionsWatchlist = optionsWatchlist?.filter(

View File

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