diff --git a/.idea/dictionaries/steffo.xml b/.idea/dictionaries/steffo.xml new file mode 100644 index 0000000..56712aa --- /dev/null +++ b/.idea/dictionaries/steffo.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/peafowl.iml b/.idea/peafowl.iml index 060f1d9..b2821ff 100644 --- a/.idea/peafowl.iml +++ b/.idea/peafowl.iml @@ -3,10 +3,18 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run.xml b/.idea/runConfigurations/Run.xml index e64f8dd..edf45b9 100644 --- a/.idea/runConfigurations/Run.xml +++ b/.idea/runConfigurations/Run.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/_components/GameRow.tsx b/_components/GameRow.tsx index 5f9f7f1..23578c6 100644 --- a/_components/GameRow.tsx +++ b/_components/GameRow.tsx @@ -4,10 +4,10 @@ import {Progress, progressToClassName, progressToIconDef, progressToTitle} from import {ratingToClassName} from "../_utils/rating.ts" -export type GameRowColumnKind = "rating" | "progress" | "name" | "hascontent" | "date" | "hoursplayed" +export type GameRowColumnKind = "rating" | "progress" | "name" | "namesort" | "hascontent" | "date" | "hoursplayed" export type GameRowColumnPriority = undefined | "rating" | "progress" | "mixed" -export const gameRowColumnKindDefault: GameRowColumnKind[] = ["rating", "name", "hascontent", "date", "progress", "hoursplayed"] +export const gameRowColumnKindDefault: GameRowColumnKind[] = ["rating", "name", "namesort", "hascontent", "date", "progress", "hoursplayed"] export type GameRowProps = { @@ -62,6 +62,13 @@ export function GameRow({game, columns = gameRowColumnKindDefault, priority}: Ga ) } + case "namesort": { + return ( + + + + ) + } case "hascontent": { return ( diff --git a/_components/GameTable.tsx b/_components/GameTable.tsx index c4f7c46..cd4e6e3 100644 --- a/_components/GameTable.tsx +++ b/_components/GameTable.tsx @@ -3,13 +3,14 @@ import {GameRow, GameRowColumnKind, gameRowColumnKindDefault, GameRowColumnPrior export type GameTableProps = { + id?: string, games: GameData[], columns?: GameRowColumnKind[] priority?: GameRowColumnPriority } -export function GameTable({games, columns = gameRowColumnKindDefault, priority}: GameTableProps) { +export function GameTable({id, games, columns = gameRowColumnKindDefault, priority}: GameTableProps) { const colElements = columns.map((column, index) => { switch(column) { case "rating": return ( @@ -56,9 +57,17 @@ export function GameTable({games, columns = gameRowColumnKindDefault, priority}: ) - case "hascontent": return ( - - + case "namesort": return ( + + + Sort by + + + ) + case "hascontent": + return ( + + @@ -86,7 +95,7 @@ export function GameTable({games, columns = gameRowColumnKindDefault, priority}: )) return ( - +
{colElements} diff --git a/_includes/index.tsx b/_includes/index.tsx index 401569e..793bf91 100644 --- a/_includes/index.tsx +++ b/_includes/index.tsx @@ -91,8 +91,10 @@ export default function(data: GlobalData, helpers: Lume.Helpers) { ) - const games_cols = (games.length > 0) ? ( -
+ const games_cols = ( + games.length > 0 + ) ? ( +

Videogames @@ -100,11 +102,6 @@ export default function(data: GlobalData, helpers: Lume.Helpers) { View all - - - Feed - -

{active_games.length > 0 && (
@@ -112,7 +109,7 @@ export default function(data: GlobalData, helpers: Lume.Helpers) {
)}
- {top_games_section} + {top_games_section} {progress_games_section}
diff --git a/_includes/list-games.tsx b/_includes/list-games.tsx index 903d933..1ed7a21 100644 --- a/_includes/list-games.tsx +++ b/_includes/list-games.tsx @@ -13,15 +13,24 @@ export default function(data: Lume.Data, helpers: Lume.Helpers) { ) : null const games: GameData[] = data.search.pages("game") - .sort((a, b) => (b.rating - a.rating)) as GameData[] const games_section = (

Videogames list + + + Feed + + + + + JSON + +

- +
) @@ -30,6 +39,8 @@ export default function(data: Lume.Data, helpers: Lume.Helpers) {
{intro_section} {games_section} +