Skip to content

Commit 05305ee

Browse files
committed
Merge branch 'main' into fix/win_icon_title
2 parents bf3e9ed + e7f8bdd commit 05305ee

File tree

4 files changed

+12
-30
lines changed

4 files changed

+12
-30
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"@hyperplay/chains": "^0.5.0",
7474
"@hyperplay/check-disk-space": "^3.5.2",
7575
"@hyperplay/quests-ui": "^0.1.23",
76-
"@hyperplay/ui": "^1.9.5",
76+
"@hyperplay/ui": "^1.9.8",
7777
"@hyperplay/utils": "^0.3.7",
7878
"@mantine/carousel": "^7.12.0",
7979
"@mantine/core": "^7.12.0",

pnpm-lock.yaml

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/backend/ipcHandlers/quests.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ async function fetchQuests({
1919
}): Promise<Quest[]> {
2020
const url = new URL(`${DEV_PORTAL_URL}api/v1/quests`)
2121
url.searchParams.append('questStatus', status)
22+
url.searchParams.append('sortBy', 'start_date')
23+
url.searchParams.append('order', 'desc')
2224
if (projectId) {
2325
url.searchParams.append('projectId', projectId)
2426
}

src/frontend/screens/Quests/index.tsx

+1-21
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { useMutation } from '@tanstack/react-query'
1010
import { Runner } from 'common/types'
1111
import { Quest } from '@hyperplay/utils'
1212
import { QuestRewardClaimedToast } from 'frontend/components/UI/QuestRewardClaimedToast'
13-
import { itemType } from '@hyperplay/ui/dist/components/Dropdowns/Dropdown'
1413
import useGetHyperPlayListings from 'frontend/hooks/useGetHyperPlayListings'
1514
import useGetQuests from 'frontend/hooks/useGetQuests'
1615
import {
@@ -41,10 +40,6 @@ export function QuestsPage() {
4140
const searchParam = searchParams.get('search')
4241
const [searchText, setSearchText] = useState(searchParam ?? '')
4342
const [activeFilter, setActiveFilter] = useState<QuestFilter>('all')
44-
const [selectedSort, setSelectedSort] = useState<itemType>({
45-
text: 'Alphabetically (ASC)',
46-
id: 'ALPHA_ASC'
47-
})
4843

4944
useEffect(() => {
5045
window.api.trackScreen('Quests Page')
@@ -123,17 +118,12 @@ export function QuestsPage() {
123118
}
124119
})
125120

126-
const sortedQuests = [...(quests ?? [])].sort((a, b) => {
127-
const sortMultiplier = selectedSort.id === 'ALPHA_ASC' ? 1 : -1
128-
return a.name.localeCompare(b.name) * sortMultiplier
129-
})
130-
131121
const gameTitleMatches = (quest: Quest) => {
132122
const title = listings ? listings[quest.project_id]?.project_meta?.name : ''
133123
return title?.toLowerCase().startsWith(searchText.toLowerCase())
134124
}
135125

136-
const searchFilteredQuests = sortedQuests?.filter((quest) => {
126+
const searchFilteredQuests = quests?.filter((quest) => {
137127
const questTitleMatch = quest.name
138128
.toLowerCase()
139129
.startsWith(searchText.toLowerCase())
@@ -152,11 +142,6 @@ export function QuestsPage() {
152142
const initialQuestId = searchFilteredQuests?.[0]?.id ?? null
153143
const visibleQuestId = selectedQuestId ?? initialQuestId
154144

155-
const achievementsSortOptions = [
156-
{ text: 'Alphabetically (ASC)', id: 'ALPHA_ASC' },
157-
{ text: 'Alphabetically (DES)', id: 'ALPHA_DES' }
158-
]
159-
160145
const imagesToPreload: string[] = []
161146
const gameElements =
162147
searchFilteredQuests?.map(({ id, project_id, name, ...rest }) => {
@@ -206,11 +191,6 @@ export function QuestsPage() {
206191
<QuestsSummaryTable
207192
games={gameElements}
208193
imagesToPreload={imagesToPreload}
209-
sortProps={{
210-
options: achievementsSortOptions,
211-
selected: selectedSort,
212-
onItemChange: setSelectedSort
213-
}}
214194
filterProps={{ activeFilter, setActiveFilter }}
215195
isFetching={questsResults?.data.isFetching}
216196
isPageLoading={questsResults?.data.isLoading}

0 commit comments

Comments
 (0)