Location Edit / Add / Delete migrated to client-side rendering

This commit is contained in:
2024-02-08 14:23:01 +01:00
parent ee02cc4f32
commit a96998baad
6 changed files with 89 additions and 26 deletions

View File

@@ -29,11 +29,23 @@ export const LocationDeleteForm:FC<LocationDeleteFormProps> = ({ location }) =>
Please confirm deletion of location <strong>{location.name}</strong>.
</p>
<div className="pt-4 text-center">
<button className="btn btn-primary">Confim</button>
<Link className="btn btn-neutral ml-3" href={`/location/${location._id}/edit/`}>Cancel</Link>
<button className="btn btn-primary w-[5.5em]">Confim</button>
<Link className="btn btn-neutral w-[5.5em] ml-3" href={`/location/${location._id}/edit/`}>Cancel</Link>
</div>
</form>
</div>
</div>
);
}
export const LocationDeleteFormSkeleton:FC = () =>
<div className="card card-compact card-bordered min-w-[20em] max-w-[90em] bg-base-100 shadow-s my-1">
<div className="card-body">
<p className="py-6 px-6"></p>
<div className="pt-4 text-center">
<div className="btn skeleton w-[5.5em]"></div>
<div className="btn ml-3 skeleton w-[5.5em]"></div>
</div>
</div>
</div>

View File

@@ -47,7 +47,7 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
))}
</div>
<textarea id="locationNotes" name="locationNotes" className="textarea textarea-bordered my-1 w-full block" placeholder="Opis" defaultValue={location?.notes ?? ""}></textarea>
<textarea id="locationNotes" name="locationNotes" className="textarea textarea-bordered my-1 w-full block h-[8em]" placeholder="Opis" defaultValue={location?.notes ?? ""}></textarea>
<div id="status-error" aria-live="polite" aria-atomic="true">
{state.errors?.locationNotes &&
state.errors.locationNotes.map((error: string) => (
@@ -79,12 +79,12 @@ export const LocationEditFormSkeleton:FC = () =>
{
return(
<div className="card card-compact card-bordered min-w-[20em] max-w-[90em] bg-base-100 shadow-s my-1">
<div className="card-body skeleton">
<div id="locationName" className="input input-bordered w-full"></div>
<div id="locationNotes" className="textarea textarea-bordered my-1 w-full block"></div>
<div className="card-body">
<div id="locationName" className="input w-full skeleton"></div>
<div id="locationNotes" className="textarea my-1 w-full block h-[8em] skeleton"></div>
<div className="pt-4">
<div className="btn btn-neutral w-[5.5em]"></div>
<div className="btn btn-neutral w-[5.5em] ml-3"></div>
<div className="btn w-[5.5em] skeleton"></div>
<div className="btn w-[5.5em] ml-3 skeleton"></div>
</div>
</div>
</div>