mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
Track preferred time preferences
This commit is contained in:
parent
8aec24308e
commit
671f5b16fd
1 changed files with 22 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
|
import { usePlausible } from "next-plausible";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Calendar from "@/components/icons/calendar.svg";
|
import Calendar from "@/components/icons/calendar.svg";
|
||||||
|
@ -12,6 +13,7 @@ const Preferences: React.VoidFunctionComponent = () => {
|
||||||
const { weekStartsOn, setWeekStartsOn, timeFormat, setTimeFormat } =
|
const { weekStartsOn, setWeekStartsOn, timeFormat, setTimeFormat } =
|
||||||
usePreferences();
|
usePreferences();
|
||||||
|
|
||||||
|
const plausible = usePlausible();
|
||||||
return (
|
return (
|
||||||
<div className="-mb-2">
|
<div className="-mb-2">
|
||||||
<div className="mb-4 flex items-center space-x-2 text-base font-semibold">
|
<div className="mb-4 flex items-center space-x-2 text-base font-semibold">
|
||||||
|
@ -29,6 +31,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
||||||
})}
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setWeekStartsOn("monday");
|
setWeekStartsOn("monday");
|
||||||
|
plausible("Change week start", {
|
||||||
|
props: {
|
||||||
|
timeFormat: "monday",
|
||||||
|
},
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
@ -40,6 +47,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
||||||
})}
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setWeekStartsOn("sunday");
|
setWeekStartsOn("sunday");
|
||||||
|
plausible("Change week start", {
|
||||||
|
props: {
|
||||||
|
timeFormat: "sunday",
|
||||||
|
},
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
@ -57,6 +69,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
||||||
})}
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTimeFormat("12h");
|
setTimeFormat("12h");
|
||||||
|
plausible("Change time format", {
|
||||||
|
props: {
|
||||||
|
timeFormat: "12h",
|
||||||
|
},
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
@ -68,6 +85,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
||||||
})}
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTimeFormat("24h");
|
setTimeFormat("24h");
|
||||||
|
plausible("Change time format", {
|
||||||
|
props: {
|
||||||
|
timeFormat: "24h",
|
||||||
|
},
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue