add hover chart to watchlist

This commit is contained in:
MuslemRahimi 2024-11-21 00:44:06 +01:00
parent 77b0bab391
commit 2d55750a91
2 changed files with 10 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { numberOfUnreadNotification } from "$lib/store"; import { numberOfUnreadNotification } from "$lib/store";
//import MiniPlot from '$lib/components/MiniPlot.svelte'; import HoverStockChart from "$lib/components/HoverStockChart.svelte";
import { abbreviateNumber } from "$lib/utils"; import { abbreviateNumber } from "$lib/utils";
import { onMount } from "svelte"; import { onMount } from "svelte";
@ -313,15 +313,10 @@
: ''} bg-[#2E3238] h-[18px] w-[18px] rounded-sm ring-offset-0 mr-3" : ''} bg-[#2E3238] h-[18px] w-[18px] rounded-sm ring-offset-0 mr-3"
/> />
{#if !editMode} {#if !editMode}
<a <HoverStockChart
class="inline-block sm:hover:text-white text-blue-400 text-sm sm:text-[1rem]" symbol={item?.ticker}
href={item?.underlying_type === "stock" assetType={item?.underlying_type}
? `/stocks/${item?.ticker}` />
: `/etf/${item?.ticker}`}
on:click|stopPropagation
>
{item?.ticker}
</a>
{:else} {:else}
<span class="text-blue-400 cursor-pointer" <span class="text-blue-400 cursor-pointer"
>{item?.ticker}</span >{item?.ticker}</span

View File

@ -8,6 +8,7 @@
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js"; import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js";
import { Button } from "$lib/components/shadcn/button/index.js"; import { Button } from "$lib/components/shadcn/button/index.js";
import { Combobox } from "bits-ui"; import { Combobox } from "bits-ui";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data; export let data;
let timeoutId; let timeoutId;
@ -1118,12 +1119,10 @@
{item?.symbol} {item?.symbol}
</label> </label>
{:else} {:else}
<a <HoverStockChart
href={`/${item?.type === "stock" ? "stocks" : item?.type === "etf" ? "etf" : "crypto"}/${item?.symbol}`} symbol={item?.symbol}
class="text-blue-400 sm:hover:text-white" assetType={item?.type}
> />
{item?.symbol}
</a>
{/if} {/if}
</td> </td>