From 0bcb86c2b900c149ddec9ec3276197e248734918 Mon Sep 17 00:00:00 2001 From: nofurtherinformation Date: Mon, 5 Aug 2024 10:49:25 -0500 Subject: [PATCH] refactor spinner and cleanup --- components/MapTooltip/MapTooltip.tsx | 14 ++------ components/MapTooltip/Spinner.css | 32 ------------------- components/Nav/Interactive.tsx | 15 +++++---- .../ReportLoadingShade/ReportLoadingShade.tsx | 21 ++++++++++++ components/ReportLoadingShade/index.ts | 5 +++ 5 files changed, 37 insertions(+), 50 deletions(-) delete mode 100644 components/MapTooltip/Spinner.css create mode 100644 components/ReportLoadingShade/ReportLoadingShade.tsx create mode 100644 components/ReportLoadingShade/index.ts diff --git a/components/MapTooltip/MapTooltip.tsx b/components/MapTooltip/MapTooltip.tsx index a1ba126..79e6854 100644 --- a/components/MapTooltip/MapTooltip.tsx +++ b/components/MapTooltip/MapTooltip.tsx @@ -6,7 +6,7 @@ import { MapState } from "utils/state/types" import { TooltipSectionsRenderer } from "./MapTooltipSections" import { MapTooltipProps } from "./types" import { adjustTooltipToMousePosition } from "./utils" -import "./Spinner.css" +import Spinner from "components/Spinner" export const MapTooltipInner: React.FC< MapTooltipProps & { tooltipStatus: MapState["tooltipStatus"]; tooltip: MapState["tooltip"] } @@ -24,16 +24,8 @@ export const MapTooltipInner: React.FC< } }) - if (!data) { - return ( - - - - ) - } - if (simpleMap) { - return

{id}

- } + if (!data) return + if (simpleMap) return

{id}

if (tooltipData) { return ( diff --git a/components/MapTooltip/Spinner.css b/components/MapTooltip/Spinner.css deleted file mode 100644 index 18358a5..0000000 --- a/components/MapTooltip/Spinner.css +++ /dev/null @@ -1,32 +0,0 @@ -.spinner { - animation: rotate 2s linear infinite; - width: 50px; - height: 50px; -} - -.path { - stroke: #5652bf; - stroke-linecap: round; - animation: dash 1.5s ease-in-out infinite; -} - -@keyframes rotate { - 100% { - transform: rotate(360deg); - } -} - -@keyframes dash { - 0% { - stroke-dasharray: 1, 150; - stroke-dashoffset: 0; - } - 50% { - stroke-dasharray: 90, 150; - stroke-dashoffset: -35; - } - 100% { - stroke-dasharray: 90, 150; - stroke-dashoffset: -124; - } -} diff --git a/components/Nav/Interactive.tsx b/components/Nav/Interactive.tsx index 4703828..d7e7dee 100644 --- a/components/Nav/Interactive.tsx +++ b/components/Nav/Interactive.tsx @@ -3,6 +3,7 @@ import React, { useState } from "react" import { HiMenu, HiX } from "react-icons/hi" import { SubNavList } from "./SubNavList" import { NavProps } from "./types" +import Link from "next/link" export const InteractiveNav: React.FC = ({ navInfo }) => { const links = navInfo.data.nav.links @@ -16,9 +17,9 @@ export const InteractiveNav: React.FC = ({ navInfo }) => { return (