Skip to content

Commit

Permalink
Set default theme to dark for widget components
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Feb 11, 2025
1 parent 689b5ce commit 098abbe
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/components/widgets/StatDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { THEME_STYLES } from "~/constants/widget";
import { cn } from "~/lib/utils";
import type { StatDisplayProps } from "~/types/widget";

export const StatDisplay: FC<StatDisplayProps> = ({ stat, theme = "default", className }) => {
export const StatDisplay: FC<StatDisplayProps> = ({ stat, theme = "dark", className }) => {
const { variable, label, value, prefix, suffix } = stat;

return (
Expand Down
2 changes: 1 addition & 1 deletion app/components/widgets/box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const BoxWidget: FC<BoxWidgetProps> = ({
variables = DEFAULT_VARIABLES,
labels = DEFAULT_LABELS,
extraArgs = {},
theme = "default",
theme = "dark",
opacity = 100,
showHeader = true,
refreshInterval = UPDATE_INTERVAL_MS,
Expand Down
2 changes: 1 addition & 1 deletion app/routes/widgets.$region.$accountId.$widgetType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function Widget() {
case "box": {
const variables = searchParams.get("vars")?.split(",");
const labels = searchParams.get("labels")?.split(",") ?? variables?.map(snakeToPretty);
const theme = (searchParams.get("theme") || "dark") as Theme;
const theme = (searchParams.get("theme") ?? "dark") as Theme;
const opacity = Number.parseFloat(searchParams.get("opacity") ?? "100");
const showHeader = searchParams.get("showHeader") !== "false";
const showBranding = searchParams.get("showBranding") !== "false";
Expand Down
2 changes: 1 addition & 1 deletion app/types/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Stat = {
suffix?: string;
};

export type Theme = "default" | "dark" | "glass" | "light";
export type Theme = "dark" | "glass" | "light";

export type Region = "Europe" | "Asia" | "NAmerica" | "SAmerica" | "Oceania";

Expand Down

0 comments on commit 098abbe

Please sign in to comment.