From 79b1a96e8c3ccec20675db5e112b507c5b08cc7e Mon Sep 17 00:00:00 2001 From: lucas lelievre Date: Mon, 7 Nov 2022 03:11:32 +0100 Subject: [PATCH] add glow effect (#30) --- src/components/home/Home.tsx | 2 +- src/components/tracker/TrackersTable.tsx | 55 +++++++++++++++++------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/components/home/Home.tsx b/src/components/home/Home.tsx index 00823bf..9b20a0a 100644 --- a/src/components/home/Home.tsx +++ b/src/components/home/Home.tsx @@ -51,7 +51,7 @@ export function Home() { )} {config?.debug && trackers.length > 0 && ( -
+
sendToSettings(tracker)} diff --git a/src/components/tracker/TrackersTable.tsx b/src/components/tracker/TrackersTable.tsx index 1c66321..cc40757 100644 --- a/src/components/tracker/TrackersTable.tsx +++ b/src/components/tracker/TrackersTable.tsx @@ -50,6 +50,7 @@ export function RowContainer({ children, rounded = 'none', hover, + tracker, onClick, onMouseOver, onMouseOut, @@ -57,23 +58,40 @@ export function RowContainer({ children: ReactChild; rounded?: 'left' | 'right' | 'none'; hover: boolean; + tracker: TrackerDataT; onClick?: MouseEventHandler; onMouseOver?: MouseEventHandler; onMouseOut?: MouseEventHandler; }) { + const { useVelocity } = useTracker(tracker); + + const velocity = useVelocity(); + return (
- {children} +
+ {children} +
); } @@ -93,12 +111,13 @@ export function TrackersTable({ return (
-
+
Tracker
{flatTrackers.map(({ tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)} @@ -108,11 +127,12 @@ export function TrackersTable({ ))}
-
+
Type
{flatTrackers.map(({ device, tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)} @@ -124,11 +144,12 @@ export function TrackersTable({ ))}
-
+
Battery
{flatTrackers.map(({ device, tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)} @@ -145,11 +166,12 @@ export function TrackersTable({ ))}
-
+
Ping
{flatTrackers.map(({ device, tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)} @@ -168,11 +190,12 @@ export function TrackersTable({ ))}
-
+
Rotation X/Y/Z
{flatTrackers.map(({ tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)} @@ -182,11 +205,12 @@ export function TrackersTable({ ))}
-
+
Position X/Y/Z
{flatTrackers.map(({ tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)} @@ -204,13 +228,14 @@ export function TrackersTable({ ))}
-
+
URL
{flatTrackers.map(({ device, tracker }, index) => ( clickedTracker(tracker)} hover={trackerEqual(tracker.trackerId)} onMouseOver={() => setHoverTracker(tracker.trackerId)}