Skip to content

Commit

Permalink
fix(frontend): move button to menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Sep 4, 2024
1 parent bcc0262 commit 5fcf0c7
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions apps/frontend/app/routes/_dashboard.media.item.$id._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -949,35 +949,34 @@ export default function Page() {
<Menu.Item onClick={mergeMetadataModalOpen}>
Merge media
</Menu.Item>
<Form
method="POST"
action={withQuery("", { intent: "removeItem" })}
>
<input
hidden
name="metadataId"
defaultValue={loaderData.metadataId}
/>
<Menu.Item
color="red"
onClick={async (e) => {
const form = e.currentTarget.form;
if (form) {
e.preventDefault();
const conf = await confirmWrapper({
confirmation:
"Are you sure you want to remove this item? This will remove it from all collections and delete all history and reviews.",
});
if (conf && form) submit(form);
}
}}
>
Remove item
</Menu.Item>
</Form>
</Menu.Dropdown>
</Menu>
<Form
method="POST"
action={withQuery("", { intent: "removeItem" })}
>
<input
hidden
name="metadataId"
defaultValue={loaderData.metadataId}
/>
<Button
w="100%"
variant="outline"
onClick={async (e) => {
const form = e.currentTarget.form;
if (form) {
e.preventDefault();
const conf = await confirmWrapper({
confirmation:
"Are you sure you want to remove this item? This will remove it from all collections and delete all history and reviews.",
});
if (conf && form) submit(form);
}
}}
>
Remove item
</Button>
</Form>
</SimpleGrid>
</MediaScrollArea>
</Tabs.Panel>
Expand Down

0 comments on commit 5fcf0c7

Please sign in to comment.