fix: improved ux for renaming and merging
Signed-off-by: Varun Raj <mailme@varunraj.in>
This commit is contained in:
1 parent
971bc77b6e
commit
9a42894341
4 files changed
+18
-3
No files matched your search
@@ -37,7 +37,7 @@ export default function PersonHideCell({ person, onUpdate }: IProps) {
|
|||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
onClick={() => handleEdit(!hidden)}
|
onClick={() => handleEdit(!hidden)}
|
||||||
className="bg-gray-200 rounded-lg px-2 py-1 text-sm border"
|
className="bg-gray-200 rounded-lg px-2 py-1 text-sm border-0"
|
||||||
>
|
>
|
||||||
{hidden ? "Show" : "Hide"}
|
{hidden ? "Show" : "Hide"}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { PersonMergeDropdown } from "./PersonMergeDropdown";
|
|||||||
import PersonBirthdayCell from "./PersonBirthdayCell";
|
import PersonBirthdayCell from "./PersonBirthdayCell";
|
||||||
import PersonHideCell from "./PersonHideCell";
|
import PersonHideCell from "./PersonHideCell";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { ENV } from "@/config/environment";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
person: IPerson;
|
person: IPerson;
|
||||||
@@ -42,7 +44,12 @@ export default function PersonItem({ person }: IProps) {
|
|||||||
src={person.thumbnailPath}
|
src={person.thumbnailPath}
|
||||||
alt={person.name}
|
alt={person.name}
|
||||||
/>
|
/>
|
||||||
<div className="absolute top-2 right-2">
|
<div className="absolute top-2 left-2 ">
|
||||||
|
<Link className="bg-green-300 rounded-lg px-2 py-1 text-sm" href={`${ENV.IMMICH_URL}/people/${person.id}`} target="_blank">
|
||||||
|
View
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
<div className="absolute top-2 right-2 ">
|
||||||
<PersonHideCell
|
<PersonHideCell
|
||||||
person={person}
|
person={person}
|
||||||
onUpdate={(newData) => {
|
onUpdate={(newData) => {
|
||||||
@@ -50,6 +57,7 @@ export default function PersonItem({ person }: IProps) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{!editMode ? (
|
{!editMode ? (
|
||||||
<h2
|
<h2
|
||||||
@@ -73,6 +81,11 @@ export default function PersonItem({ person }: IProps) {
|
|||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setFormData({ ...formData, name: e.target.value });
|
setFormData({ ...formData, name: e.target.value });
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
handleEdit();
|
||||||
|
}
|
||||||
|
}}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
onBlur={handleEdit}
|
onBlur={handleEdit}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -84,9 +84,10 @@ export function PersonMergeDropdown(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSelect = (value: IPerson) => {
|
const handleSelect = (value: IPerson) => {
|
||||||
|
setOpen(false);
|
||||||
return mergePerson(person.id, value.id)
|
return mergePerson(person.id, value.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setOpen(false);
|
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
@@ -5,6 +5,7 @@ export interface IPerson {
|
|||||||
thumbnailPath: string;
|
thumbnailPath: string;
|
||||||
isHidden: boolean;
|
isHidden: boolean;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IPeopleListResponse extends IListData{
|
interface IPeopleListResponse extends IListData{
|
||||||
|
|||||||
Reference in new issue
Block a user