Directory tab inside Project Profile page not displayed properly (tab within tab issue) #464

Merged
pramod.mahajan merged 2 commits from Kartik_Bug#1408 into OnFieldWork_V1 2025-10-09 12:56:41 +00:00
Showing only changes of commit 5c8a6c8c65 - Show all commits

View File

@ -139,9 +139,8 @@ export default function DirectoryPage({ IsPage = true, projectId = null }) {
<ul className="nav nav-tabs">
<li className="nav-item cursor-pointer">
<a
className={`nav-link ${
activeTab === "notes" ? "active" : ""
} fs-6`}
className={`nav-link ${activeTab === "notes" ? "active" : ""
} fs-6`}
onClick={(e) => handleTabClick("notes", e)}
>
<i className="bx bx-notepad bx-sm me-1_5"></i>
@ -150,9 +149,8 @@ export default function DirectoryPage({ IsPage = true, projectId = null }) {
</li>
<li className="nav-item cursor-pointer">
<a
className={`nav-link ${
activeTab === "contacts" ? "active" : ""
} fs-6`}
className={`nav-link ${activeTab === "contacts" ? "active" : ""
} fs-6`}
onClick={(e) => handleTabClick("contacts", e)}
>
<i className="bx bxs-contact bx-sm me-1_5"></i>
@ -160,94 +158,94 @@ export default function DirectoryPage({ IsPage = true, projectId = null }) {
</a>
</li>
</ul>
</div>
<div className="mb-1 px-2 py-3">
<div className="d-flex align-items-center justify-content-between">
<div className="d-flex align-items-center gap-3">
{activeTab === "notes" && (
<input
type="search"
className="form-control form-control-sm"
placeholder="Search notes..."
value={searchNote}
onChange={(e) => setSearchNote(e.target.value)}
/>
)}
<div className="mb-1 px-2 py-3">
<div className="d-flex align-items-center justify-content-between">
<div className="d-flex align-items-center gap-3">
{activeTab === "notes" && (
<input
type="search"
className="form-control form-control-sm"
placeholder="Search notes..."
value={searchNote}
onChange={(e) => setSearchNote(e.target.value)}
/>
)}
{activeTab === "contacts" && (
<div className="d-flex align-items-center gap-3">
<div className="d-flex gap-2 align-items-center">
<input
type="search"
className="form-control form-control-sm"
placeholder="Search contacts..."
value={searchContact}
onChange={(e) => setsearchContact(e.target.value)}
/>
{activeTab === "contacts" && (
<div className="d-flex align-items-center gap-3">
<div className="d-flex gap-2 align-items-center">
<input
type="search"
className="form-control form-control-sm"
placeholder="Search contacts..."
value={searchContact}
onChange={(e) => setsearchContact(e.target.value)}
/>
<button
className={`btn btn-sm p-1 ${gridView ? " btn-primary" : " btn-outline-primary"
}`}
onClick={() => setGridView(true)}
>
<i className="bx bx-grid-alt"></i>
</button>
<button
className={`btn btn-sm p-1 ${
gridView ? " btn-primary" : " btn-outline-primary"
}`}
onClick={() => setGridView(true)}
>
<i className="bx bx-grid-alt"></i>
</button>
<button
className={`btn btn-sm p-1 ${
!gridView ? "btn-primary" : "btn-outline-primary"
}`}
onClick={() => setGridView(false)}
>
<i className="bx bx-list-ul"></i>
</button>
<button
className={`btn btn-sm p-1 ${!gridView ? "btn-primary" : "btn-outline-primary"
}`}
onClick={() => setGridView(false)}
>
<i className="bx bx-list-ul"></i>
</button>
</div>
</div>
<div className="form-check form-switch d-flex align-items-center m-0">
<input
type="checkbox"
className="form-check-input"
role="switch"
id="inactiveEmployeesCheckbox"
checked={showActive}
onChange={(e) => setShowActive(e.target.checked)}
/>
<label
className="form-check-label ms-2"
htmlFor="inactiveEmployeesCheckbox"
)}
</div>
<div class="dropdown z-2">
<button type="button"
class="btn btn-xs btn-icon btn-text-secondary rounded-pill dropdown-toggle hide-arrow p-0 m-0" data-bs-toggle="dropdown" aria-expanded="true">
<i class="bx bx-dots-vertical-rounded text-muted p-0" data-bs-toggle="tooltip"
data-bs-offset="0,8" data-bs-placement="top" data-bs-custom-class="tooltip-dark" title="More Action">
</i>
</button>
<ul class="dropdown-menu dropdown-menu-end p-5" data-popper-placement="bottom-end"
>
<li>
<a
className="dropdown-item cursor-pointer"
onClick={() => handleExport("csv")}
>
{showActive ? "Active" : "Inactive"} Contacts
</label>
</div>
</div>
)}
</div>
<i className="bx bx-file"></i> Export to CSV
</a>
</li>
{activeTab === "contacts" && (
<li>
<div className="form-check form-switch d-flex align-items-center m-0">
<input
type="checkbox"
className="form-check-input"
role="switch"
id="inactiveEmployeesCheckbox"
checked={showActive}
onChange={(e) => setShowActive(e.target.checked)}
/>
<label
className="form-check-label ms-2"
htmlFor="inactiveEmployeesCheckbox"
>
{showActive ? "Active" : "Inactive"} Contacts
</label>
</div>
</li>
)}
</ul>
</div>
<div className="btn-group">
<button
className="btn btn-sm btn-label-secondary dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<i className="bx bx-export me-2 bx-sm"></i>Export
</button>
<ul className="dropdown-menu">
<li>
<a
className="dropdown-item cursor-pointer"
onClick={() => handleExport("csv")}
>
<i className="bx bx-file me-1"></i> CSV
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>