update background color

This commit is contained in:
hamid zarghami
2026-07-20 09:56:04 +03:30
parent ee792b69bf
commit bd65d28ea3
3 changed files with 27 additions and 9 deletions
+5 -3
View File
@@ -15,7 +15,7 @@ import { Pages } from "../../../config/Pages";
import { ErrorType } from "../../../helpers/types";
import { useSingleUpload } from "../../service/hooks/useServiceData";
import CreateProjectSidebar, {
BACKGROUND_PRESETS,
findMatchingBackgroundPreset,
SelectedUser,
} from "./components/CreateProjectSidebar";
import { useGetProjectDetail, useUpdateProject } from "./hooks/useProjectData";
@@ -32,7 +32,7 @@ const UpdateProject: FC = () => {
const [isActive, setIsActive] = useState(true);
const [selectedColor, setSelectedColor] = useState("#A8E6CF");
const [selectedUsers, setSelectedUsers] = useState<SelectedUser[]>([]);
const [selectedBackground, setSelectedBackground] = useState<string>(BACKGROUND_PRESETS[0]);
const [selectedBackground, setSelectedBackground] = useState<string | null>(null);
const [backgroundImage, setBackgroundImage] = useState<File | null>(null);
const [workspaceId, setWorkspaceId] = useState("");
const [existingBackgroundPicture, setExistingBackgroundPicture] = useState("");
@@ -119,7 +119,9 @@ const UpdateProject: FC = () => {
: "",
});
setIsActive(project.isActive);
setSelectedColor(project.backgroundColor ?? "#A8E6CF");
const backgroundColor = project.backgroundColor ?? "#A8E6CF";
setSelectedBackground(findMatchingBackgroundPreset(backgroundColor));
setSelectedColor(backgroundColor);
setWorkspaceId(project.workspaceId);
setExistingBackgroundPicture(project.backgroundPicture ?? "");
setStartDateDefault(