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
6 changes: 6 additions & 0 deletions src/_Main/MainLocal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ function MainLocal() {
newList = newList.filter((mod) => category.has(mod.parent));
}
switch (sort) {
case "alpha-asc":
newList.sort((a, b) => a.name.localeCompare(b.name));
break;
case "alpha-desc":
newList.sort((a, b) => b.name.localeCompare(a.name));
break;
case "fav-asc":
newList.sort((a, b) => {
const aFav = a.tags?.includes("fav") ? 1 : 0;
Expand Down
4 changes: 2 additions & 2 deletions src/_Main/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function TopBar() {
{
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
<PopoverTrigger asChild>
<div className="min-w-fit button-like zzz-border hover:brightness-150 bg-sidebar cursor-pointerx flex items-center justify-center h-full gap-1 p-2 text-xs duration-300 rounded-md select-none">
<div className="min-w-fit button-like zzz-border hover:brightness-150 bg-sidebar cursor-pointerx flex items-center justify-center text-center h-full gap-1 p-2 text-xs duration-300 rounded-md select-none">
{online ? (
onlinePath.startsWith("home") || onlinePath.startsWith("search") ? (
onlineType == "Mod" ? (
Expand Down Expand Up @@ -241,7 +241,7 @@ function TopBar() {
Object.entries(SORT_OPTIONS).map(([value, label]) => (
<div
key={value}
className="hover:brightness-150 button-like data-zzz:bg-button zzz-border bg-sidebar min-h-12 cursor-pointerx flex items-center justify-center w-full gap-1 p-2 text-sm duration-300 rounded-md select-none"
className="hover:brightness-150 button-like data-zzz:bg-button zzz-border bg-sidebar min-h-12 cursor-pointerx flex items-center justify-center text-center w-full gap-1 p-2 text-sm duration-300 rounded-md select-none"
onClick={() => {
setSort(value);
}}
Expand Down
16 changes: 8 additions & 8 deletions src/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ export const SORT_OPTIONS = Object.fromEntries(
label: "Default",
value: "default",
},
// {
// label: "A-Z",
// value: "alpha-asc",
// },
// {
// label: "Z-A",
// value: "alpha-desc",
// },
{
label: "A - Z",
value: "alpha-asc",
},
{
label: "Z - A",
value: "alpha-desc",
},
{
label: "Favourite ↑",
value: "fav-asc",
Expand Down