Skip to content

Commit

Permalink
changed to useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaBonde committed Dec 9, 2024
1 parent 05dcc8a commit 1578b7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { format } from "date-fns";
import { on } from "events";
import { set } from "lodash";
import { useLayoutEffect, useMemo, useRef, useState } from "react";
import { useEffect, useLayoutEffect, useRef, useState } from "react";

export function EditDateInput({
value,
Expand All @@ -21,7 +21,7 @@ export function EditDateInput({
const inputRef = useRef<HTMLInputElement | null>(null);
const [clicked, setClicked] = useState(false);

useMemo(() => {
useEffect(() => {
if (!inEdit) {
setClicked(false);
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Agreement/components/EditTextarea.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLayoutEffect, useMemo, useRef, useState } from "react";
import { useEffect, useLayoutEffect, useRef, useState } from "react";

export function EditTextarea({
value,
Expand All @@ -16,7 +16,7 @@ export function EditTextarea({
const inputRef = useRef<HTMLTextAreaElement | null>(null);
const [clicked, setClicked] = useState(false);

useMemo(() => {
useEffect(() => {
if (!inEdit) {
setClicked(false);
}
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/components/Staffing/ConsultantRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,8 @@ export default function ConsultantRows({
e.bookingDetails.projectId > 0 && e.bookingDetails.type == "Offer",
)
.map((e) => e.bookingDetails.endDateAgreement);
if (dates.some((e) => e === null)) {
console.log("dates", dates);
console.log(consultant.detailedBooking);
}

if (dates.some((e) => e === null)) {
console.log("this true", consultant);
return <AlertCircle color="red" size={20} className="w-1/12" />;
} else if (dates.length > 0) {
const newestDate = dates.reduce((a, b) => {
Expand Down

0 comments on commit 1578b7e

Please sign in to comment.