From 0765c333482774e950891dcfe38611b67fbf3bff Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Feb 2025 03:20:04 +0200 Subject: [PATCH] Added widget opacity controller, updated light theme styling --- app/components/widget-builder.tsx | 293 ++++++++++-------- app/components/widgets/MatchHistory.tsx | 11 +- app/components/widgets/StatDisplay.tsx | 16 +- app/components/widgets/box.tsx | 66 +++- ...widgets.$region.$accountId.$widgetType.tsx | 3 + app/types/match-history.ts | 9 +- app/types/widget.ts | 4 +- 7 files changed, 237 insertions(+), 165 deletions(-) diff --git a/app/components/widget-builder.tsx b/app/components/widget-builder.tsx index 5eaf3ec..8792482 100644 --- a/app/components/widget-builder.tsx +++ b/app/components/widget-builder.tsx @@ -35,6 +35,7 @@ export default function WidgetBuilder({ region, accountId }: WidgetBuilderProps) const [showMatchHistory, setShowMatchHistory] = useState(true); const [matchHistoryShowsToday, setMatchHistoryShowsToday] = useState(false); const [numMatches, setNumMatches] = useState(10); + const [opacity, setOpacity] = useState(100); const { data, error } = useQuery({ queryKey: ["available-variables"], @@ -62,6 +63,7 @@ export default function WidgetBuilder({ region, accountId }: WidgetBuilderProps) url.searchParams.set("showMatchHistory", showMatchHistory.toString()); url.searchParams.set("matchHistoryShowsToday", matchHistoryShowsToday.toString()); url.searchParams.set("numMatches", numMatches.toString()); + url.searchParams.set("opacity", opacity.toString()); for (const [arg, value] of Object.entries(extraArgs)) { if (value) url.searchParams.set(arg, value); } @@ -81,6 +83,7 @@ export default function WidgetBuilder({ region, accountId }: WidgetBuilderProps) showMatchHistory={showMatchHistory} matchHistoryShowsToday={matchHistoryShowsToday} numMatches={numMatches} + opacity={opacity} />, ); break; @@ -100,6 +103,7 @@ export default function WidgetBuilder({ region, accountId }: WidgetBuilderProps) matchHistoryShowsToday, showMatchHistory, numMatches, + opacity, ]); const themes: { value: Theme; label: string }[] = [ @@ -110,70 +114,76 @@ export default function WidgetBuilder({ region, accountId }: WidgetBuilderProps) return (
-
-
- - -
- -
- - -
- -
-
- setShowHeader(e.target.checked)} - className="rounded border-gray-300 text-blue-500 focus:ring-blue-500" - /> -