Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix for 1569 - On Dashboard in List View Lock Menu missing #1570

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading