ui fixes
This commit is contained in:
parent
d0111d91d8
commit
0abb00e416
@ -55,10 +55,6 @@
|
|||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
let modalTitle = "n/a";
|
|
||||||
let modalDescription = "n/a";
|
|
||||||
let modalLink = "#";
|
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
title: "Location Tracker",
|
title: "Location Tracker",
|
||||||
@ -201,6 +197,31 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let options = plotData();
|
let options = plotData();
|
||||||
|
|
||||||
|
function latestInfoDate(inputDate) {
|
||||||
|
// Create a Date object for the input date and convert it to New York time zone
|
||||||
|
const inputDateLocal = new Date(inputDate).toLocaleString("en-US", {
|
||||||
|
timeZone: "America/New_York",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get the current date and time in New York timezone
|
||||||
|
const todayLocal = new Date().toLocaleString("en-US", {
|
||||||
|
timeZone: "America/New_York",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Convert the localized strings back to Date objects
|
||||||
|
const inputDateMs = new Date(inputDateLocal).getTime();
|
||||||
|
const todayMs = new Date(todayLocal).getTime();
|
||||||
|
|
||||||
|
// Calculate the difference in milliseconds
|
||||||
|
const differenceInMs = todayMs - inputDateMs;
|
||||||
|
|
||||||
|
// Convert milliseconds to days
|
||||||
|
const differenceInDays = Math.floor(differenceInMs / (1000 * 60 * 60 * 24));
|
||||||
|
|
||||||
|
// Return whether the difference is less than or equal to 1 day
|
||||||
|
return differenceInDays <= 2;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SEO
|
<SEO
|
||||||
@ -401,12 +422,12 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-sm text-gray-400">
|
<span class="text-sm sm:text-[1rem] text-gray-400">
|
||||||
{item.time_formatted} - {item.location}
|
{item.time_formatted} - {item.location}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-sm ml-7">
|
<span class="text-sm sm:text-[1rem] ml-7">
|
||||||
{item.details}
|
{item.details}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -416,17 +437,23 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<h3 class="text-white text-lg font-semibold mb-2 mt-6">
|
<h3 class="text-white text-lg font-semibold mb-2 mt-6">
|
||||||
Latest Executive Orders analyzed by AI
|
AI-Powered Analysis of the Latest Executive Orders
|
||||||
</h3>
|
</h3>
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
{#each Object.entries(groupedOrders) as [date, items], indexA}
|
{#each Object.entries(groupedOrders) as [date, items], indexA}
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<div
|
<div
|
||||||
class="border-b border-gray-800 pb-2 flex flex-row items-center justify-between"
|
class="border-b border-gray-800 pb-2 flex flex-row items-center"
|
||||||
>
|
>
|
||||||
<span class="text-lg font-semibold text-white"
|
<span class="text-lg font-semibold text-white"
|
||||||
>{date}</span
|
>{date}</span
|
||||||
>
|
>
|
||||||
|
{#if latestInfoDate(date)}
|
||||||
|
<label
|
||||||
|
class="bg-[#fff] rounded text-black font-semibold text-xs px-2 py-0.5 ml-3 inline-block"
|
||||||
|
>New</label
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
@ -472,35 +499,39 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-sm">
|
<div
|
||||||
|
class="text-sm flex flex-col items-start w-full mb-1"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
class="{item?.sentiment === 'Bullish'
|
class="text-white sm:text-lg font-semibold inline-block"
|
||||||
? 'bg-emerald-500 text-white'
|
|
||||||
: item?.sentiment === 'Bearish'
|
|
||||||
? 'bg-red-600 text-white'
|
|
||||||
: 'bg-white text-black'} py-1 rounded text-xs w-fit px-2 font-medium"
|
|
||||||
>
|
|
||||||
{item?.sentiment}
|
|
||||||
</span>
|
|
||||||
-
|
|
||||||
<span class="text-white font-bold"
|
|
||||||
>{item.title}</span
|
>{item.title}</span
|
||||||
>
|
>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-sm ml-7 pt-3">{item.description}</span
|
<div
|
||||||
|
class="ml-7 {item?.sentiment === 'Bullish'
|
||||||
|
? 'bg-emerald-500 text-white'
|
||||||
|
: item?.sentiment === 'Bearish'
|
||||||
|
? 'bg-red-600 text-white'
|
||||||
|
: 'bg-white text-black'} py-1 rounded text-xs sm:text-sm w-fit px-2 font-medium"
|
||||||
|
>
|
||||||
|
{item?.sentiment}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="text-[1rem] ml-7 pt-2"
|
||||||
|
>{item.description}</span
|
||||||
>
|
>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
href={item?.link}
|
href={item?.link}
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="ml-7 inline-block text-sm text-white hover:underline"
|
class="ml-7 inline-block text-sm sm:text-[1rem] text-white hover:underline"
|
||||||
>
|
>
|
||||||
Source
|
Source
|
||||||
<svg
|
<svg
|
||||||
class="w-4 h-4 -mt-0.5 inline-block"
|
class="w-4 h-4 sm:w-5 sm:h-5 -mt-0.5 inline-block"
|
||||||
fill="#fff"
|
fill="#fff"
|
||||||
viewBox="0 0 64 64"
|
viewBox="0 0 64 64"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
|
|||||||
@ -185,7 +185,6 @@
|
|||||||
async function handlePushSubscribe() {
|
async function handlePushSubscribe() {
|
||||||
loading = true;
|
loading = true;
|
||||||
const output = await subscribeUser();
|
const output = await subscribeUser();
|
||||||
console.log(output);
|
|
||||||
if (output?.success === true) {
|
if (output?.success === true) {
|
||||||
isPushSubscribed = true;
|
isPushSubscribed = true;
|
||||||
toast.success("Push notification activated successfully!", {
|
toast.success("Push notification activated successfully!", {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user