Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/frontend/src/components/ui/NavTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
v-show="link.shown ?? true"
:key="link.href"
ref="tabLinkElements"
:replace="replace"
:to="query ? (link.href ? `?${query}=${link.href}` : '?') : link.href"
class="button-animation z-[1] flex flex-row items-center gap-2 px-4 py-2 focus:rounded-full"
:class="getSSRFallbackClasses(index)"
Expand Down Expand Up @@ -70,6 +71,7 @@ interface Tab {

const props = withDefaults(
defineProps<{
replace?: boolean
links: Tab[]
query?: string
mode?: 'navigation' | 'local'
Expand Down
56 changes: 31 additions & 25 deletions apps/frontend/src/pages/[type]/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@
ref="downloadModal"
:on-show="
() => {
navigateTo({ query: route.query, hash: '#download' })
navigateTo({ query: route.query, hash: '#download' }, { replace: true })
}
"
:on-hide="
() => {
navigateTo({ query: route.query, hash: '' })
navigateTo({ query: route.query, hash: '' }, { replace: true })
}
"
>
Expand Down Expand Up @@ -240,18 +240,21 @@
platformAccordion.open()
}

navigateTo({
query: {
...route.query,
...(userSelectedGameVersion && {
version: userSelectedGameVersion,
}),
...(userSelectedPlatform && {
loader: userSelectedPlatform,
}),
navigateTo(
{
query: {
...route.query,
...(userSelectedGameVersion && {
version: userSelectedGameVersion,
}),
...(userSelectedPlatform && {
loader: userSelectedPlatform,
}),
},
hash: route.hash,
},
hash: route.hash,
})
{ replace: true },
)
}
"
>
Expand Down Expand Up @@ -341,18 +344,21 @@
gameVersionAccordion.open()
}

navigateTo({
query: {
...route.query,
...(userSelectedGameVersion && {
version: userSelectedGameVersion,
}),
...(userSelectedPlatform && {
loader: userSelectedPlatform,
}),
navigateTo(
{
query: {
...route.query,
...(userSelectedGameVersion && {
version: userSelectedGameVersion,
}),
...(userSelectedPlatform && {
loader: userSelectedPlatform,
}),
},
hash: route.hash,
},
hash: route.hash,
})
{ replace: true },
)
}
"
>
Expand Down Expand Up @@ -907,7 +913,7 @@
</div>

<div class="normal-page__content">
<div class="overflow-x-auto"><NavTabs :links="navLinks" class="mb-4" /></div>
<div class="overflow-x-auto"><NavTabs :links="navLinks" replace class="mb-4" /></div>
<NuxtPage @on-download="triggerDownloadAnimation" @delete-version="deleteVersion" />
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/pages/collection/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
}
}),
]"
replace
/>

<ProjectCardList
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/pages/discover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const selectableProjectTypes = [
<NavTabs
v-if="!flags.projectTypesPrimaryNav && allowTabChanging"
:links="selectableProjectTypes"
replace
class="hidden md:flex"
/>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/pages/organization/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
</div>
</div>
<div v-if="navLinks.length > 2" class="mb-4 max-w-full overflow-x-auto">
<NavTabs :links="navLinks" />
<NavTabs :links="navLinks" replace />
</div>
<ProjectCardList v-if="projects && projects.length > 0">
<ProjectCard
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/pages/user/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
</div>
<div class="normal-page__content">
<div v-if="navLinks.length > 2" class="mb-4 max-w-full overflow-x-auto">
<NavTabs :links="navLinks" />
<NavTabs :links="navLinks" replace />
</div>
<div v-if="projects.length > 0">
<ProjectCardList
Expand Down