Skip to content

Commit

Permalink
Merge pull request #1570 from MyLiveCV/BUG-1569
Browse files Browse the repository at this point in the history
Bug Fix for 1569 - `On Dashboard in List View Lock Menu missing`
  • Loading branch information
AmruthPillai authored Nov 23, 2023
2 parents c53ecc5 + 482c0b4 commit edc46da
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
CopySimple,
DotsThreeVertical,
FolderOpen,
Lock,
LockOpen,
PencilSimple,
TrashSimple,
} from "@phosphor-icons/react";
Expand Down Expand Up @@ -38,6 +40,7 @@ type Props = {
export const ResumeListItem = ({ resume }: Props) => {
const navigate = useNavigate();
const { open } = useDialog<ResumeDto>("resume");
const { open: lockOpen } = useDialog<ResumeDto>("lock");

const { url } = useResumePreview(resume.id);

Expand All @@ -55,6 +58,10 @@ export const ResumeListItem = ({ resume }: Props) => {
open("duplicate", { id: "resume", item: resume });
};

const onLockChange = () => {
lockOpen(resume.locked ? "update" : "create", { id: "lock", item: resume });
};

const onDelete = () => {
open("delete", { id: "resume", item: resume });
};
Expand Down Expand Up @@ -153,6 +160,17 @@ export const ResumeListItem = ({ resume }: Props) => {
<CopySimple size={14} className="mr-2" />
{t`Duplicate`}
</ContextMenuItem>
{resume.locked ? (
<ContextMenuItem onClick={onLockChange}>
<LockOpen size={14} className="mr-2" />
{t`Unlock`}
</ContextMenuItem>
) : (
<ContextMenuItem onClick={onLockChange}>
<Lock size={14} className="mr-2" />
{t`Lock`}
</ContextMenuItem>
)}
<ContextMenuSeparator />
<ContextMenuItem onClick={onDelete} className="text-error">
<TrashSimple size={14} className="mr-2" />
Expand Down

0 comments on commit edc46da

Please sign in to comment.