Convert header display settings to dropdown (v1.33.1)
This commit is contained in:
parent
b827f39722
commit
58de23a18f
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "my-weekly-todo-list",
|
"name": "my-weekly-todo-list",
|
||||||
"version": "1.33.0",
|
"version": "1.33.1",
|
||||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -10863,52 +10863,22 @@ function SettingsSidebar({
|
|||||||
<label style={{ fontSize: "0.85rem", fontWeight: 600, color: "var(--weekly-settings-label)" }}>
|
<label style={{ fontSize: "0.85rem", fontWeight: 600, color: "var(--weekly-settings-label)" }}>
|
||||||
{t.headerDisplay}
|
{t.headerDisplay}
|
||||||
</label>
|
</label>
|
||||||
<div className="flex items-center gap-1 bg-gray-100 dark:bg-gray-800 rounded p-1 mt-1" style={{ width: "fit-content" }}>
|
<div className="mt-1">
|
||||||
<button
|
<select
|
||||||
onClick={() => {
|
value={profile.headerDisplay || "kw"}
|
||||||
setProfile({ ...profile, headerDisplay: "kw" });
|
onChange={(e) => {
|
||||||
saveSetting("headerDisplay", "kw");
|
const val = e.target.value as any;
|
||||||
|
setProfile({ ...profile, headerDisplay: val });
|
||||||
|
saveSetting("headerDisplay", val);
|
||||||
}}
|
}}
|
||||||
className={`px-4 py-2 text-sm rounded transition-colors ${(profile.headerDisplay || "kw") === "kw" ? "bg-white shadow-sm font-bold text-black" : "text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:hover:bg-gray-700"}`}
|
className="weekly-input w-full p-2 border border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white rounded"
|
||||||
>
|
>
|
||||||
{t.headerDisplayKW}
|
<option value="kw">{t.headerDisplayKW}</option>
|
||||||
</button>
|
<option value="month">{t.headerDisplayMonth}</option>
|
||||||
<button
|
<option value="month_year">{t.headerDisplayMonthYear}</option>
|
||||||
onClick={() => {
|
<option value="date">{t.headerDisplayDate}</option>
|
||||||
setProfile({ ...profile, headerDisplay: "month" });
|
<option value="custom">{t.headerDisplayCustom}</option>
|
||||||
saveSetting("headerDisplay", "month");
|
</select>
|
||||||
}}
|
|
||||||
className={`px-4 py-2 text-sm rounded transition-colors ${profile.headerDisplay === "month" ? "bg-white shadow-sm font-bold text-black" : "text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:hover:bg-gray-700"}`}
|
|
||||||
>
|
|
||||||
{t.headerDisplayMonth}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
setProfile({ ...profile, headerDisplay: "month_year" });
|
|
||||||
saveSetting("headerDisplay", "month_year");
|
|
||||||
}}
|
|
||||||
className={`px-4 py-2 text-sm rounded transition-colors ${profile.headerDisplay === "month_year" ? "bg-white shadow-sm font-bold text-black" : "text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:hover:bg-gray-700"}`}
|
|
||||||
>
|
|
||||||
{t.headerDisplayMonthYear}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
setProfile({ ...profile, headerDisplay: "date" });
|
|
||||||
saveSetting("headerDisplay", "date");
|
|
||||||
}}
|
|
||||||
className={`px-4 py-2 text-sm rounded transition-colors ${profile.headerDisplay === "date" ? "bg-white shadow-sm font-bold text-black" : "text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:hover:bg-gray-700"}`}
|
|
||||||
>
|
|
||||||
{t.headerDisplayDate}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
setProfile({ ...profile, headerDisplay: "custom" });
|
|
||||||
saveSetting("headerDisplay", "custom");
|
|
||||||
}}
|
|
||||||
className={`px-4 py-2 text-sm rounded transition-colors ${profile.headerDisplay === "custom" ? "bg-white shadow-sm font-bold text-black" : "text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:hover:bg-gray-700"}`}
|
|
||||||
>
|
|
||||||
{t.headerDisplayCustom}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
{profile.headerDisplay === "custom" && (
|
{profile.headerDisplay === "custom" && (
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user