update ui

This commit is contained in:
MuslemRahimi 2024-09-21 19:54:56 +02:00
parent d02b71b6dd
commit dd069c720a
2 changed files with 23 additions and 3 deletions

View File

@ -227,11 +227,16 @@ onMount( async() => {
</div>
-->
<h1 class="text-white text-3xl font-semibold text-start w-full pl-4 pb-4 sm:pb-2">
<h1 class="hidden sm:block text-3xl lg:text-5xl text-white font-bold text-center mb-10 relative w-fit flex justify-center m-auto">
Stock Analysis for
<span class="italic text-[#FBCE3C]">Data Freaks</span>
</h1>
<h1 class="text-white text-2xl font-semibold text-start w-full pb-4 sm:pl-4 sm:pb-2">
Dashboard
</h1>
<main class="flex flex-1 flex-col gap-4 sm:p-4 md:gap-8">
<div class="grid gap-4 grid-cols-2 md:gap-8 lg:grid-cols-4">

View File

@ -133,6 +133,21 @@ async function handleChangeValue(value) {
}
function handleReset() {
filterList = [];
checkedItems = new Set();
economicCalendar = data?.getEconomicCalendar;
daysOfWeek = getDaysOfWeek(currentWeek);
formattedWeekday = daysOfWeek.map(day => format(day.date, "EEE, MMM d"));
weekday = getWeekdayData(economicCalendar, daysOfWeek);
rawData = weekday;
previousMax = differenceInWeeks(currentWeek, today) <= -maxWeeksChange;
nextMax = differenceInWeeks(currentWeek, today) >= maxWeeksChange;
currentWeek = startOfWeek(today, { weekStartsOn: 1 });
selectedWeekday = Math.min((currentDate.getDay() + 6) % 7, 4)
}
</script>
@ -347,7 +362,7 @@ async function handleChangeValue(value) {
</DropdownMenu.Root>
{#if filterList?.length !== 0}
<Button on:click={() => {filterList = []; checkedItems = new Set();} } class="w-fit border-gray-600 border bg-[#09090B] sm:hover:bg-[#27272A] ease-out flex flex-row justify-start items-center px-3 py-2 text-white rounded-lg truncate">
<Button on:click={() => handleReset()} class="w-fit border-gray-600 border bg-[#09090B] sm:hover:bg-[#27272A] ease-out flex flex-row justify-start items-center px-3 py-2 text-white rounded-lg truncate">
<svg xmlns="http://www.w3.org/2000/svg" class="inline-block w-4 h-4 mr-2" viewBox="0 0 21 21"><g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M3.578 6.487A8 8 0 1 1 2.5 10.5"/><path d="M7.5 6.5h-4v-4"/></g></svg>
Reset All
</Button>