mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 08:28:35 +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 { useTranslation } from "next-i18next";
|
||||
import { usePlausible } from "next-plausible";
|
||||
import React from "react";
|
||||
|
||||
import Calendar from "@/components/icons/calendar.svg";
|
||||
|
@ -12,6 +13,7 @@ const Preferences: React.VoidFunctionComponent = () => {
|
|||
const { weekStartsOn, setWeekStartsOn, timeFormat, setTimeFormat } =
|
||||
usePreferences();
|
||||
|
||||
const plausible = usePlausible();
|
||||
return (
|
||||
<div className="-mb-2">
|
||||
<div className="mb-4 flex items-center space-x-2 text-base font-semibold">
|
||||
|
@ -29,6 +31,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
|||
})}
|
||||
onClick={() => {
|
||||
setWeekStartsOn("monday");
|
||||
plausible("Change week start", {
|
||||
props: {
|
||||
timeFormat: "monday",
|
||||
},
|
||||
});
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
|
@ -40,6 +47,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
|||
})}
|
||||
onClick={() => {
|
||||
setWeekStartsOn("sunday");
|
||||
plausible("Change week start", {
|
||||
props: {
|
||||
timeFormat: "sunday",
|
||||
},
|
||||
});
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
|
@ -57,6 +69,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
|||
})}
|
||||
onClick={() => {
|
||||
setTimeFormat("12h");
|
||||
plausible("Change time format", {
|
||||
props: {
|
||||
timeFormat: "12h",
|
||||
},
|
||||
});
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
|
@ -68,6 +85,11 @@ const Preferences: React.VoidFunctionComponent = () => {
|
|||
})}
|
||||
onClick={() => {
|
||||
setTimeFormat("24h");
|
||||
plausible("Change time format", {
|
||||
props: {
|
||||
timeFormat: "24h",
|
||||
},
|
||||
});
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue