fix: create new project as fav (#1993)

This commit is contained in:
sriram veeraghanta 2023-08-28 13:09:27 +05:30 committed by GitHub
parent a9ff4b8c93
commit 9f420a00d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ import { useMobxStore } from "lib/mobx/store-provider";
export const ProjectSidebarList: FC = () => { export const ProjectSidebarList: FC = () => {
const store: any = useMobxStore(); const store: any = useMobxStore();
const [isFavoriteProjectCreate, setIsFavoriteProjectCreate] = useState(false);
const [isProjectModalOpen, setIsProjectModalOpen] = useState(false); const [isProjectModalOpen, setIsProjectModalOpen] = useState(false);
const [deleteProjectModal, setDeleteProjectModal] = useState(false); const [deleteProjectModal, setDeleteProjectModal] = useState(false);
const [projectToDelete, setProjectToDelete] = useState<IProject | null>(null); const [projectToDelete, setProjectToDelete] = useState<IProject | null>(null);
@ -151,7 +152,7 @@ export const ProjectSidebarList: FC = () => {
<CreateProjectModal <CreateProjectModal
isOpen={isProjectModalOpen} isOpen={isProjectModalOpen}
setIsOpen={setIsProjectModalOpen} setIsOpen={setIsProjectModalOpen}
setToFavorite setToFavorite={isFavoriteProjectCreate}
user={user} user={user}
/> />
<DeleteProjectModal <DeleteProjectModal
@ -189,7 +190,10 @@ export const ProjectSidebarList: FC = () => {
</Disclosure.Button> </Disclosure.Button>
<button <button
className="group-hover:opacity-100 opacity-0" className="group-hover:opacity-100 opacity-0"
onClick={() => setIsProjectModalOpen(true)} onClick={() => {
setIsFavoriteProjectCreate(true);
setIsProjectModalOpen(true);
}}
> >
<Icon iconName="add" /> <Icon iconName="add" />
</button> </button>
@ -252,7 +256,10 @@ export const ProjectSidebarList: FC = () => {
</Disclosure.Button> </Disclosure.Button>
<button <button
className="group-hover:opacity-100 opacity-0" className="group-hover:opacity-100 opacity-0"
onClick={() => setIsProjectModalOpen(true)} onClick={() => {
setIsFavoriteProjectCreate(false);
setIsProjectModalOpen(true);
}}
> >
<Icon iconName="add" /> <Icon iconName="add" />
</button> </button>