Skip to content

Commit

Permalink
fix(messages): properly hide create tasks from Message component
Browse files Browse the repository at this point in the history
  • Loading branch information
nimdanitro committed Dec 4, 2024
1 parent 7efdaab commit 4e769db
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions ui/src/views/journal/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dayjs from "dayjs";
import de from "dayjs/locale/de";
import LocalizedFormat from "dayjs/plugin/localizedFormat";
import relativeTime from "dayjs/plugin/relativeTime";

import { useBooleanFlagValue } from "@openfeature/react-sdk";
import { faArrowsToEye, faEdit, faPrint, faSquareCheck } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { memo } from "react";
Expand Down Expand Up @@ -47,6 +47,7 @@ function Message({
}: MessageProps) {
const { t } = useTranslation();
const { incidentId, journalId } = useParams();
const showTasks = useBooleanFlagValue("show-tasks", false);

const colorClassNames = classNames({
"is-danger":
Expand Down Expand Up @@ -169,14 +170,18 @@ function Message({
) : (
<></>
)}
<li>
<a>
<span className="icon is-small">
<FontAwesomeIcon icon={faSquareCheck} />
</span>
<span>{t("createNewTask")}</span>
</a>
</li>
{showTasks ? (
<li>
<a>
<span className="icon is-small">
<FontAwesomeIcon icon={faSquareCheck} />
</span>
<span>{t("createNewTask")}</span>
</a>
</li>
) : (
<></>
)}
</ul>
</div>
) : (
Expand Down

0 comments on commit 4e769db

Please sign in to comment.