You've already forked AstralRinth
forked from didirus/AstralRinth
feat(frontend): Add filter query and download hash to the url during download modal use (#3138)
* feat: Automatically open download modal when filter queries are present * chore: Use a hash to open the modal, and make the filter queries independent of the modal * chore: Correct to use emit for taking functions * chore: Add filter query and download hash to the url during modal use, and fix linting issues * chore(frontend): Undo changes to NewModal My computer does not like running the app, making testing a lot harder, so I'll undo this change, at least for now * Remove extra line --------- Signed-off-by: Prospector <6166773+Prospector@users.noreply.github.com> Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
494616e9f2
commit
ec5e3b0050
@@ -184,7 +184,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<NewModal ref="downloadModal">
|
<NewModal
|
||||||
|
ref="downloadModal"
|
||||||
|
:on-show="
|
||||||
|
() => {
|
||||||
|
navigateTo({ query: route.query, hash: '#download' });
|
||||||
|
}
|
||||||
|
"
|
||||||
|
:on-hide="
|
||||||
|
() => {
|
||||||
|
navigateTo({ query: route.query, hash: '' });
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<Avatar :src="project.icon_url" :alt="project.title" class="icon" size="32px" />
|
<Avatar :src="project.icon_url" :alt="project.title" class="icon" size="32px" />
|
||||||
<div class="truncate text-lg font-extrabold text-contrast">
|
<div class="truncate text-lg font-extrabold text-contrast">
|
||||||
@@ -303,6 +315,15 @@
|
|||||||
if (!currentPlatform && platformAccordion) {
|
if (!currentPlatform && platformAccordion) {
|
||||||
platformAccordion.open();
|
platformAccordion.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
navigateTo({
|
||||||
|
query: {
|
||||||
|
...route.query,
|
||||||
|
...(userSelectedGameVersion && { version: userSelectedGameVersion }),
|
||||||
|
...(userSelectedPlatform && { loader: userSelectedPlatform }),
|
||||||
|
},
|
||||||
|
hash: route.hash,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
@@ -379,6 +400,15 @@
|
|||||||
if (!currentGameVersion && gameVersionAccordion) {
|
if (!currentGameVersion && gameVersionAccordion) {
|
||||||
gameVersionAccordion.open();
|
gameVersionAccordion.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
navigateTo({
|
||||||
|
query: {
|
||||||
|
...route.query,
|
||||||
|
...(userSelectedGameVersion && { version: userSelectedGameVersion }),
|
||||||
|
...(userSelectedPlatform && { loader: userSelectedPlatform }),
|
||||||
|
},
|
||||||
|
hash: route.hash,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
@@ -828,6 +858,7 @@ import {
|
|||||||
} from "@modrinth/ui";
|
} from "@modrinth/ui";
|
||||||
import VersionSummary from "@modrinth/ui/src/components/version/VersionSummary.vue";
|
import VersionSummary from "@modrinth/ui/src/components/version/VersionSummary.vue";
|
||||||
import { formatCategory, isRejected, isStaff, isUnderReview, renderString } from "@modrinth/utils";
|
import { formatCategory, isRejected, isStaff, isUnderReview, renderString } from "@modrinth/utils";
|
||||||
|
import { navigateTo } from "#app";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import ModrinthIcon from "~/assets/images/utils/modrinth.svg?component";
|
import ModrinthIcon from "~/assets/images/utils/modrinth.svg?component";
|
||||||
import Accordion from "~/components/ui/Accordion.vue";
|
import Accordion from "~/components/ui/Accordion.vue";
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const props = withDefaults(
|
|||||||
closeOnClickOutside: true,
|
closeOnClickOutside: true,
|
||||||
closeOnEsc: true,
|
closeOnEsc: true,
|
||||||
warnOnClose: false,
|
warnOnClose: false,
|
||||||
header: null,
|
header: undefined,
|
||||||
onHide: () => {},
|
onHide: () => {},
|
||||||
onShow: () => {},
|
onShow: () => {},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user