update similar ticker component

This commit is contained in:
MuslemRahimi 2024-08-02 15:21:34 +02:00
parent 4d0ecf5e3f
commit 184b437f56
2 changed files with 5 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts">
import {stockTicker, similarTickerClicked, screenWidth} from '$lib/store';
import {similarTickerClicked, screenWidth} from '$lib/store';
import { goto } from '$app/navigation';
import { abbreviateNumber } from '$lib/utils';
@ -9,12 +9,12 @@ export let similarstock;
async function stockSelector(state)
async function stockSelector(symbol)
{
window?.scroll({ top: 0, left: 0, behavior: 'smooth' });
stockTicker.update(value => state);
//stockTicker.update(value => symbol);
$similarTickerClicked = true;
goto("/stocks/"+state+"/")
goto("/stocks/"+symbol)
}
@ -35,7 +35,6 @@ export let similarstock;
{#if similarstock?.length !== 0}
<div class="flex justify-start items-center w-full m-auto ">
<table class="table table-sm table-compact mt-3 text-start flex justify-start items-center w-full px-3 m-auto">
<thead>

View File

@ -24,10 +24,8 @@ import { displayCompanyName, stockTicker, assetType, isOpen, isAfterMarketClose,
export const load = async ({ params, data }) => {
stockTicker.update( value => params.tickerID?.toUpperCase());
assetType.update( value => 'stock');
displayCompanyName.update(value => data?.companyName)
await checkMarketHour();