Merge pull request 'Toggle Button Functionality for Deleted Notes Not Working Correctly' (#375) from Kartik_Bug#1056 into Document_Manag

Reviewed-on: #375
This commit is contained in:
Vikas Nale 2025-09-09 05:33:50 +00:00
commit 849709ad05

View File

@ -128,42 +128,40 @@ const NotesDirectory = ({
<div className="col d-flex justify-content-end gap-2 pe-0"> <div className="col d-flex justify-content-end gap-2 pe-0">
{" "} {" "}
<div className="d-flex align-items-center justify-content-between"> <div className="d-flex align-items-center justify-content-between">
<label <label
className="switch switch-primary" className="switch switch-primary"
style={{ style={{
fontSize: "15px", fontSize: "15px",
}} }}
> >
<input <input
type="checkbox" type="checkbox"
className="switch-input" className="switch-input"
onChange={() => handleSwitch(!IsActive)} onChange={handleSwitch}
checked={IsActive} checked={!IsActive} // invert binding
style={{ style={{ transform: "scale(0.8)" }}
transform: "scale(0.8)", // smaller toggle />
}} <span
/> className="switch-toggle-slider"
<span
className="switch-toggle-slider"
style={{ style={{
width: "30px", // narrower slider width: "30px", // narrower slider
height: "15px", // shorter slider height: "15px", // shorter slider
}} }}
> >
<span className="switch-on"></span> <span className="switch-on"></span>
<span className="switch-off"></span> <span className="switch-off"></span>
</span> </span>
<span <span
className="switch-label" className="switch-label"
style={{ style={{
fontSize: "14px", // smaller label text fontSize: "14px", // smaller label text
marginLeft: "-14px" marginLeft: "-14px"
}} }}
> >
Include Deleted Notes Include Deleted Notes
</span> </span>
</label> </label>
{!showEditor && ( {!showEditor && (
<div className="d-flex justify-content-end"> <div className="d-flex justify-content-end">
@ -225,23 +223,23 @@ const NotesDirectory = ({
)} )}
{!isLoading && notesToDisplay.length > 0 {!isLoading && notesToDisplay.length > 0
? notesToDisplay ? notesToDisplay
.slice() .slice()
.reverse() .reverse()
.map((noteItem) => ( .map((noteItem) => (
<NoteCardDirectory <NoteCardDirectory
refetchProfile={refetchProfile} refetchProfile={refetchProfile}
refetchNotes={refetch} refetchNotes={refetch}
refetchContact={refetch} refetchContact={refetch}
noteItem={noteItem} noteItem={noteItem}
contactId={contactProfile?.id} contactId={contactProfile?.id}
setProfileContact={setProfileContact} setProfileContact={setProfileContact}
key={noteItem.id} key={noteItem.id}
/> />
)) ))
: !isLoading && : !isLoading &&
!showEditor && ( !showEditor && (
<div className="text-center mt-5">{noNotesMessage}</div> <div className="text-center mt-5">{noNotesMessage}</div>
)} )}
</div> </div>
</div> </div>
); );