Skip to content

Commit 33ba546

Browse files
Add Create Item button on location page (#1189)
* this is a test. add item fucntionality added * feat: collapse text on mobile --------- Co-authored-by: Ell <tonya@tokia.dev>
1 parent 3e473cf commit 33ba546

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

frontend/pages/location/[id].vue

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { useLocationStore } from "~~/stores/locations";
66
import MdiLoading from "~icons/mdi/loading";
77
import MdiPackageVariant from "~icons/mdi/package-variant";
8+
import MdiPlus from "~icons/mdi/plus";
89
import MdiPencil from "~icons/mdi/pencil";
910
import MdiDelete from "~icons/mdi/delete";
1011
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
@@ -97,6 +98,10 @@
9798
openDialog(DialogID.UpdateLocation);
9899
}
99100
101+
function openCreateItem() {
102+
openDialog(DialogID.CreateItem);
103+
}
104+
100105
async function update() {
101106
updating.value = true;
102107
updateData.parentId = parent.value?.id || null;
@@ -217,15 +222,25 @@
217222
</div>
218223
</div>
219224
</div>
220-
<div class="ml-auto mt-2 flex flex-wrap items-center justify-between gap-3">
225+
<div class="ml-auto mt-2 flex flex-wrap items-center justify-between gap-2">
221226
<LabelMaker :id="location.id" type="location" />
222-
<Button @click="openUpdate">
227+
<Button @click="openCreateItem" class="w-9 md:w-auto">
228+
<MdiPlus name="mdi-plus" />
229+
<span class="hidden md:inline">
230+
{{ $t("components.item.create_modal.title") }}
231+
</span>
232+
</Button>
233+
<Button @click="openUpdate" class="w-9 md:w-auto">
223234
<MdiPencil name="mdi-pencil" />
224-
{{ $t("global.edit") }}
235+
<span class="hidden md:inline">
236+
{{ $t("global.edit") }}
237+
</span>
225238
</Button>
226-
<Button variant="destructive" @click="confirmDelete()">
239+
<Button variant="destructive" @click="confirmDelete()" class="w-9 md:w-auto">
227240
<MdiDelete name="mdi-delete" />
228-
{{ $t("global.delete") }}
241+
<span class="hidden md:inline">
242+
{{ $t("global.delete") }}
243+
</span>
229244
</Button>
230245
</div>
231246
</div>

0 commit comments

Comments
 (0)