comment modificiation
This commit is contained in:
parent
05aadcfcb6
commit
17a6e37037
@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import { DateTime } from "luxon"; // Import Luxon for timezone conversion
|
import { DateTime } from "luxon";
|
||||||
|
|
||||||
import useWidgetAPI from "../../../utils/proxy/use-widget-api";
|
import useWidgetAPI from "../../../utils/proxy/use-widget-api";
|
||||||
import Error from "../../../components/services/widget/error";
|
import Error from "../../../components/services/widget/error";
|
||||||
@ -21,7 +21,7 @@ export default function Filter({ widget }) {
|
|||||||
const tasksToAdd = tasksData.slice(0, widget.maxTasks || tasksData.length).map((task) => ({
|
const tasksToAdd = tasksData.slice(0, widget.maxTasks || tasksData.length).map((task) => ({
|
||||||
title: task.content || t("Untitled Task by Label"),
|
title: task.content || t("Untitled Task by Label"),
|
||||||
date: task.due ? DateTime.fromISO(task.due.date, { zone: widget.timeZone }).toJSDate() : null,
|
date: task.due ? DateTime.fromISO(task.due.date, { zone: widget.timeZone }).toJSDate() : null,
|
||||||
color: widget.color || task.color || "blue", // Adjust color based on your preference
|
color: widget.color || task.color || "blue",
|
||||||
description: task.tags ? task.tags.join(", ") : "",
|
description: task.tags ? task.tags.join(", ") : "",
|
||||||
url: task.url,
|
url: task.url,
|
||||||
id: task.id,
|
id: task.id,
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export default function Label({ widget }) {
|
|||||||
const tasksToAdd = tasksData.slice(0, widget.maxTasks || tasksData.length).map((task) => ({
|
const tasksToAdd = tasksData.slice(0, widget.maxTasks || tasksData.length).map((task) => ({
|
||||||
title: task.content || t("Untitled Task by Label"),
|
title: task.content || t("Untitled Task by Label"),
|
||||||
date: task.due ? DateTime.fromISO(task.due.date, { zone: widget.timeZone }).toJSDate() : null,
|
date: task.due ? DateTime.fromISO(task.due.date, { zone: widget.timeZone }).toJSDate() : null,
|
||||||
color: widget.color || task.color || "blue", // Adjust color based on your preference
|
color: widget.color || task.color || "blue",
|
||||||
description: task.tags ? task.tags.join(", ") : "",
|
description: task.tags ? task.tags.join(", ") : "",
|
||||||
url: task.url,
|
url: task.url,
|
||||||
id: task.id,
|
id: task.id,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useMemo } from "react";
|
|||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
|
|
||||||
import Container from "components/services/widget/container";
|
import Container from "components/services/widget/container";
|
||||||
import Block from "components/services/widget/block"; // Assuming this component renders the category name as a block-level element
|
import Block from "components/services/widget/block";
|
||||||
|
|
||||||
export default function Component({ service }) {
|
export default function Component({ service }) {
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
@ -15,7 +15,7 @@ export default function Component({ service }) {
|
|||||||
.map((category) => ({
|
.map((category) => ({
|
||||||
service: dynamic(() => import(`./categories/${category.sort}`)),
|
service: dynamic(() => import(`./categories/${category.sort}`)),
|
||||||
widget: { ...widget, ...category },
|
widget: { ...widget, ...category },
|
||||||
categoryName: category.category_name, // Add categoryName property
|
categoryName: category.category_name,
|
||||||
})) ?? [],
|
})) ?? [],
|
||||||
[widget]
|
[widget]
|
||||||
);
|
);
|
||||||
|
|||||||
@ -27,8 +27,8 @@ export default function Event({ task, colorVariants }) {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex flex-row text-theme-700 dark:text-theme-200 items-center text-xs relative h-5 w-full rounded-md bg-theme-200/50 dark:bg-theme-900/20 mt-1"
|
className="flex flex-row text-theme-700 dark:text-theme-200 items-center text-xs relative h-5 w-full rounded-md bg-theme-200/50 dark:bg-theme-900/20 mt-1"
|
||||||
onMouseEnter={() => setHover(true)} // Change to setHover(true) and setHover(false)
|
onMouseEnter={() => setHover(true)}
|
||||||
onMouseLeave={() => setHover(false)} // Change to setHover(false)
|
onMouseLeave={() => setHover(false)}
|
||||||
key={`task-${task.id}`}
|
key={`task-${task.id}`}
|
||||||
>
|
>
|
||||||
<span className="ml-2 w-10">
|
<span className="ml-2 w-10">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user