diff --git a/frontend/app/components/Client/Projects/ProjectList.tsx b/frontend/app/components/Client/Projects/ProjectList.tsx index fa473ee3e..bb8816b09 100644 --- a/frontend/app/components/Client/Projects/ProjectList.tsx +++ b/frontend/app/components/Client/Projects/ProjectList.tsx @@ -10,7 +10,6 @@ function ProjectList() { const list = projectsStore.list; const [search, setSearch] = React.useState(''); const config = projectsStore.config; - console.log('config', config.pid); const onSearch = (value: string) => { setSearch(value); @@ -21,16 +20,15 @@ function ProjectList() { }; return ( -
+
-
item.name.toLowerCase().includes(search.toLowerCase()))} renderItem={(item: Project) => ( onProjectClick(item)} - className={`!py-2 mb-2 rounded-lg cursor-pointer !border-b-0 ${config.pid == item.projectId ? 'bg-teal-light' : 'bg-white'}`} + className={`!py-2 mb-2 rounded-lg cursor-pointer !border-b-0 ${config.project?.projectId === item.projectId ? 'bg-teal-light' : 'bg-white'}`} > )} - pagination={{ - pageSize: 5, - showSizeChanger: false, - size: 'small' - }} + // pagination={{ + // pageSize: 5, + // showSizeChanger: false, + // size: 'small' + // }} />
); diff --git a/frontend/app/components/Client/Projects/Projects.tsx b/frontend/app/components/Client/Projects/Projects.tsx index 434f24028..f6984ac19 100644 --- a/frontend/app/components/Client/Projects/Projects.tsx +++ b/frontend/app/components/Client/Projects/Projects.tsx @@ -7,11 +7,14 @@ import { useStore } from '@/mstore'; import { observer } from 'mobx-react-lite'; import { PlusIcon } from 'lucide-react'; import ProjectTabContent from 'Components/Client/Projects/ProjectTabContent'; +import NewSiteForm from 'Components/Client/Sites/NewSiteForm'; +import { useModal } from 'Components/ModalContext'; function Projects() { const { projectsStore } = useStore(); const history = useHistory(); const { project, pid, tab } = projectsStore.config; + const { openModal, closeModal } = useModal(); React.useEffect(() => { const params = new URLSearchParams(history.location.search); @@ -33,6 +36,12 @@ function Projects() { history.push({ search: params.toString() }); }, [pid, tab]); + const createProject = () => { + openModal(, { + title: 'New Project' + }); + }; + return ( - + } > diff --git a/frontend/app/components/Client/Projects/TagForm.tsx b/frontend/app/components/Client/Projects/TagForm.tsx index f3bdcee83..4165fc79a 100644 --- a/frontend/app/components/Client/Projects/TagForm.tsx +++ b/frontend/app/components/Client/Projects/TagForm.tsx @@ -31,8 +31,11 @@ function TagForm(props: Props) { }); }; - const onSave = () => { - void tagWatchStore.updateTagName(tag.tagId, name, projectId); + const onSave = async () => { + setLoading(true); + tagWatchStore.updateTagName(tag.tagId, name, projectId).finally(() => { + setLoading(false); + }); }; return ( @@ -52,7 +55,7 @@ function TagForm(props: Props) {