Skip to content

Commit

Permalink
264 legge til dropdown ikon når man velger satelitt homepage (#283)
Browse files Browse the repository at this point in the history
* feat(frontend): ✨ add dropdown icon

* decrease update interval
  • Loading branch information
Lukas Thrane authored and GitHub committed Apr 13, 2024
1 parent 8fad13a commit 478fec9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion frontend/src/components/homeComponents/SatDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ export default function SatDropdown({
return (
<div className="w-full">
<button
className="block w-full cursor-pointer bg-black p-4 text-left text-xl font-bold tracking-wide"
className="flex w-full cursor-pointer flex-row items-center justify-between bg-black p-4 text-left text-xl font-bold tracking-wide"
onClick={toggleDropdown}
>
{selectedSatellite || "Select a Satellite"}
<svg
xmlns="http://www.w3.org/2000/svg"
width="2em"
height="2em"
viewBox="0 0 24 24"
>
<path fill="currentColor" d="m7 10l5 5l5-5z" />
</svg>
</button>

{isOpen && <hr />}
<motion.div
className={cn("overflow-hidden", isOpen && "overflow-y-scroll")}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/homeComponents/homeGlobe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSatelliteStore } from "@/lib/store";
import { convertSatrec } from "@/lib/convertSatrec";

const SAT_RADIUS = 5; // Relative size of the satellite for visualization
const UPDATE_INTERVAL_MS = 1000; // Update interval in milliseconds
const UPDATE_INTERVAL_MS = 100; // Update interval in milliseconds
const EARTH_RADIUS_KM = 6371; // Earth radius in kilometers

export default function SatelliteGlobe() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { convertSatrec, SatelliteInfo } from "@/lib/convertSatrec";
import { useSatelliteStore } from "@/lib/store";
import { flag } from "country-emoji";

const updateInterval = 1000;
const updateInterval = 50;

export default function SatelliteDataHome() {
const { satelliteData, fetchAndSetSatelliteData, selectedSatellite } =
Expand Down

0 comments on commit 478fec9

Please sign in to comment.