diff --git a/src/pages/Directory/Directory.jsx b/src/pages/Directory/Directory.jsx index ecc6e910..70dfc102 100644 --- a/src/pages/Directory/Directory.jsx +++ b/src/pages/Directory/Directory.jsx @@ -15,6 +15,9 @@ import usePagination from "../../hooks/usePagination"; import { ITEMS_PER_PAGE } from "../../utils/constants"; import ProfileContactDirectory from "../../components/Directory/ProfileContactDirectory"; import ConfirmModal from "../../components/common/ConfirmModal"; +import DirectoryListTableHeader from "./DirectoryListTableHeader"; +import DirectoryPageHeader from "./DirectoryPageHeader"; +import ManageBucket from "../../components/Directory/ManageBucket"; const Directory = () => { @@ -29,7 +32,8 @@ const Directory = () => const [listView, setListView] = useState(false); const [selectedBucketIds, setSelectedBucketIds] = useState([]); const [deleteContact, setDeleteContact] = useState(null); - const [IsDeleting, setIsDeletng] = useState(false); + const [ IsDeleting, setIsDeletng ] = useState( false ); + const [openBucketModal,setOpenBucketModal] = useState(false) const [tempSelectedBucketIds, setTempSelectedBucketIds] = useState([]); const [tempSelectedCategoryIds, setTempSelectedCategoryIds] = useState([]); @@ -37,7 +41,8 @@ const Directory = () => const { contacts, loading } = useDirectory(IsActive); const { contactCategory, loading: contactCategoryLoading } = useContactCategory(); - const { buckets } = useBuckets(); + const {buckets} = useBuckets(); + const submitContact = async (data) => { try { let response; @@ -248,216 +253,43 @@ const Directory = () => )} -
-
-
- setSearchText(e.target.value)} - /> -
- - -
-
-
- + {openBucketModal && ( + setOpenBucketModal(false)} + size="md" + > + + + )} -
    -
    -

    Filter by

    - - {/* Bucket Filter */} -
    -

    Buckets

    -
    - {filteredBuckets.map(({ id, name }) => ( -
    - handleTempBucketChange(id)} - /> - -
    - ))} -
    -
    -
    - {/* Category Filter */} -
    -

    Categories

    -
    - {filteredCategories.map(({ id, name }) => ( -
    - handleTempCategoryChange(id)} - /> - -
    - ))} -
    -
    - -
    - - -
    -
    -
-
-
-
-
- - -
-
+
+ {!listView && loading &&

Loading...

} {!listView && !loading && currentItems.length == 0 && (

No Matching Contact Found

)} {listView ? ( -
- - - - - - - - - - {IsActive && } - - - - {loading && ( + + {loading && ( @@ -467,8 +299,7 @@ const Directory = () => )} - - {!loading && + {!loading && currentItems.map((contact) => ( IsDeleted={setDeleteContact} /> ))} - -
-
- alert("User icon clicked")} - /> - Name -
-
-
- - Email -
-
-
- alert("User icon clicked")} - /> - Phone -
-
-
- - Organization -
-
CategoryAction
Loading...
No Matching Contact Found
-
+ ) : (
{!loading && currentItems.map((contact, index) => (