ui fixes
This commit is contained in:
parent
ad366052c0
commit
86b29b2d6a
@ -613,18 +613,24 @@ export const formatDate = (dateString) => {
|
||||
const date = new Date(dateString);
|
||||
const now = new Date();
|
||||
const diffInDays = Math.floor((now - date) / (1000 * 60 * 60 * 24));
|
||||
|
||||
|
||||
if (diffInDays >= 30) {
|
||||
const months = Math.floor(diffInDays / 30);
|
||||
return `${months} month${months > 1 ? "s" : ""} ago`;
|
||||
}
|
||||
|
||||
if (diffInDays >= 7) {
|
||||
const weeks = Math.floor(diffInDays / 7);
|
||||
return `${weeks} week${weeks > 1 ? "s" : ""} ago`;
|
||||
}
|
||||
|
||||
|
||||
return formatDistanceToNow(date, {
|
||||
addSuffix: true,
|
||||
includeSeconds: false,
|
||||
}).replace(/about /i, "");
|
||||
};
|
||||
|
||||
|
||||
export const formatRuleValue = (rule) => {
|
||||
if (["interestIncome", "interestExpenses"].includes(rule.name)) {
|
||||
return `$${rule.value === 1000 ? `${rule.value / 1000} Bn` : `${rule.value} Mio`}`;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import { formatDate } from "$lib/utils";
|
||||
import ArrowLogo from "lucide-svelte/icons/move-up-right";
|
||||
import avatar from "$lib/images/visual_mod.webp";
|
||||
|
||||
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
|
||||
import { onMount } from "svelte";
|
||||
import { numberOfUnreadNotification } from "$lib/store";
|
||||
|
||||
@ -125,8 +125,8 @@
|
||||
<img
|
||||
style="clip-path: circle(50%);"
|
||||
class="flex-shrink-0 w-11 h-11 rounded-full inline-block"
|
||||
src={avatar}
|
||||
alt="User avatar"
|
||||
src={`https://financialmodelingprep.com/image-stock/${item?.liveResults?.symbol}.png`}
|
||||
alt="Company Logo"
|
||||
/>
|
||||
</a>
|
||||
|
||||
@ -135,30 +135,27 @@
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<div class="flex flex-col items-start">
|
||||
<div>
|
||||
<a
|
||||
href={`/${item?.liveResults?.assetType === "stock" ? "stocks" : "etf"}/${item?.liveResults?.symbol}`}
|
||||
class="flex flex-col items-start cursor-pointer"
|
||||
>
|
||||
<div class="flex flex-col items-start">
|
||||
<div class="text-md mt-0.5">
|
||||
Price Alert triggered for <span
|
||||
class="sm:hover:text-white text-blue-400"
|
||||
>${item?.liveResults?.symbol}</span
|
||||
>
|
||||
Price Alert triggered for <HoverStockChart
|
||||
symbol={item?.liveResults?.symbol}
|
||||
assetType={item?.liveResults?.assetType}
|
||||
/>
|
||||
</div>
|
||||
<div class="text-md mt-0.5">
|
||||
The price of <span class="font-bold"
|
||||
>${item?.liveResults?.currentPrice}</span
|
||||
The price of <span class="font-semibold"
|
||||
>{item?.liveResults?.currentPrice}</span
|
||||
>
|
||||
is {item?.liveResults?.condition} your target of
|
||||
<span class="font-bold"
|
||||
>${item?.liveResults?.targetPrice}</span
|
||||
<span class="font-semibold"
|
||||
>{item?.liveResults?.targetPrice}</span
|
||||
>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-sm sm:text-[1rem] text-[#A6ADBB0"
|
||||
>{formatDate(item?.created)} ago</span
|
||||
>
|
||||
<span class="text-sm mt-1 text-[#A6ADBB0"
|
||||
>{formatDate(item?.created)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user