mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
added url params to links
This commit is contained in:
parent
6c9311de52
commit
eed958f8bc
@ -41,6 +41,7 @@ export function HeaderView({ item, api, editCallback, deleteCallback, setPositio
|
||||
|
||||
const [address, setAdress] = React.useState<string>("");
|
||||
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
|
||||
|
||||
const openDeleteModal = async (event: React.MouseEvent<HTMLElement>) => {
|
||||
@ -91,7 +92,7 @@ export function HeaderView({ item, api, editCallback, deleteCallback, setPositio
|
||||
</label>
|
||||
<ul tabIndex={0} className="tw-dropdown-content tw-menu tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-z-1000">
|
||||
{((api?.updateItem && hasUserPermission(api.collectionName!, "update", item)) || item.layer?.customEditLink) && editCallback && <li>
|
||||
<a className="!tw-text-base-content tw-cursor-pointer" onClick={(e) => item.layer?.customEditLink ? navigate(`${item.layer.customEditLink}${item.layer.customEditParameter ? "/" + getValue(item, item.layer.customEditParameter) : ""} `) : editCallback(e)}>
|
||||
<a className="!tw-text-base-content tw-cursor-pointer" onClick={(e) => item.layer?.customEditLink ? navigate(`${item.layer.customEditLink}${item.layer.customEditParameter ? `/${getValue(item, item.layer.customEditParameter)}${params && "?"+params}` : ""} `) : editCallback(e)}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="tw-h-5 tw-w-5" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" />
|
||||
</svg>
|
||||
|
||||
@ -249,7 +249,7 @@ export function OverlayItemProfileSettings({ userType }: { userType: string }) {
|
||||
.then(() => item && updateItem({ ...item, ...changedItem }))
|
||||
.then(() => {
|
||||
setLoading(false);
|
||||
navigate("/item/" + item.id)
|
||||
navigate(`/item/${item.id}${params && "?"+params}`)
|
||||
});
|
||||
|
||||
}
|
||||
@ -268,7 +268,7 @@ export function OverlayItemProfileSettings({ userType }: { userType: string }) {
|
||||
.then(() => item && addItem({ ...item, ...changedItem, layer: item.layer, user_created: user, type: item.layer?.itemType }))
|
||||
.then(() => {
|
||||
setLoading(false);
|
||||
navigate("/")
|
||||
navigate(`/${params && "?"+params}`)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -320,6 +320,7 @@ export function OverlayItemProfileSettings({ userType }: { userType: string }) {
|
||||
setTemplate(item.layer?.itemType.template || userType);
|
||||
}, [userType, item])
|
||||
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user