-
+
{{ $t(error.userMessage) }}
@@ -74,42 +72,43 @@ import {
UIEmpty
} from '@/components/ui'
import CenteredWrapper from '@/components/community/CenteredWrapper.vue'
+import CommunityHeader from '@/components/community/CommunityHeader.vue'
import ProjectItem from '@/components/project/item/ProjectItem.vue'
-const params = useRouteQuery<'q' | 'p' | 'o'>()
+const queryParams = useRouteQuery<'q' | 'p' | 'o'>()
-const keyword = computed(() => params.get('q') ?? '')
+const keyword = computed(() => queryParams.get('q') ?? '')
-const pageSize = 8 // 2 rows
+const pageSize = 8 // 2 rows, TODO: responsive layout
const defaultPage = 1
const page = computed({
get() {
- const pageStr = params.get('p')
+ const pageStr = queryParams.get('p')
if (pageStr == null || pageStr === '') return defaultPage
const page = parseInt(pageStr)
return isNaN(page) ? defaultPage : page
},
set(p) {
- params.set('p', p === defaultPage ? null : p.toString())
+ queryParams.set('p', p === defaultPage ? null : p.toString())
}
})
enum Order {
RecentlyUpdated = 'update',
- MostlyLiked = 'likes',
- MostlyRemixed = 'remix'
+ MostLikes = 'likes',
+ MostRemixes = 'remix'
}
const defaultOrder = Order.RecentlyUpdated
const order = computed({
get() {
- const orderStr = params.get('o')
+ const orderStr = queryParams.get('o')
if (orderStr == null || orderStr === '') return defaultOrder
if (!Object.values(Order).includes(orderStr as Order)) return defaultOrder
return orderStr as Order
},
set(o) {
- params.set({
+ queryParams.set({
o: o === defaultOrder ? null : o,
p: null
})
@@ -131,11 +130,11 @@ const listParams = computed(() => {
p.orderBy = 'uTime'
p.sortOrder = 'desc'
break
- case Order.MostlyLiked:
+ case Order.MostLikes:
p.orderBy = 'likeCount'
p.sortOrder = 'desc'
break
- case Order.MostlyRemixed:
+ case Order.MostRemixes:
p.orderBy = 'remixCount'
p.sortOrder = 'desc'
break
@@ -173,29 +172,8 @@ const titleForNoResult = computed(() => ({