diff --git a/public/assets/games/Games_Steam.csv b/public/assets/games/Games_Steam.csv index e81a43d..82c20c9 100644 --- a/public/assets/games/Games_Steam.csv +++ b/public/assets/games/Games_Steam.csv @@ -42535,7 +42535,7 @@ Petrified Demo,, Conquer: Napoleonic Wars,, ALTAIR BREAKER - ROYAL SET,, Panique à Temple A-Steak Soundtrack,, -Persona 3 Reload,, +Persona 3 Reload,,https://image.nostr.build/440a646b13cb9cb95b261eb56dd27ca36a2c7a2caab2571b2605842ea6624d6a.jpg GigaBash - Godzilla 4 Kaiju Pack,, Mike's Arcade,, STAR WARS Jedi: Survivor™ Deluxe Edition Key,, @@ -73896,7 +73896,7 @@ Touhou Endless Dream,, Zombie Defense Shelter,, Rest House 2 - The Wizard,, Terraforming Mars - Prelude,, -ELDEN RING,, +ELDEN RING,,https://image.nostr.build/6fe622a3594b5d0fa1e80a3d277deebba4e5ca7bd995cc0ab7f17df057423812.jpg Virage Rally,, Ballavita,, Blackstone Academy for the Magical Arts,, @@ -76133,7 +76133,7 @@ The Purification,, Xuan-Yuan Sword VII Outfit DLC– Afterglow of Mohists,, Dum Dum Dinos Demo,, Snow Survival,, -FINAL FANTASY VII REMAKE INTERGRADE,, +FINAL FANTASY VII REMAKE INTERGRADE,,https://image.nostr.build/cc1ae58f1c2fb4c955398eeb0917acc6a88c768d0e02267e2aa30bfb9c92e19c.jpg Escape from hospital,, Roots of Evil,, Dum Dum Dinos,, @@ -95354,7 +95354,7 @@ DLC-富人遗产,, DLC-奇妙小屋,, Souls of Blades,, Put In - Run Out,, -Cyberpunk 2077,, +Cyberpunk 2077,,https://image.nostr.build/77e6e989450245630243b4410fea74fa56ed092f95c4c45bc6c949ee3ebc2de7.jpg Zombie Army 4: Zombie Gentleman Dress Uniform Character,, Zombie Army 4: Berserker Boris Outfit,, Zombie Army 4: Holiday Weapon Skins,, @@ -202716,7 +202716,7 @@ SunnySide,, Cloudbuilt,, LONESTAR,, Into the Emberlands - Supporter Pack,, -Caravan Sandwitch,, +Caravan Sandwitch,,https://s2.ezgif.com/tmp/ezgif-2-a4cdee2a97.jpg Nine Sols,, Stardeus,, Keyboard Tennis Demo,, diff --git a/src/constants.ts b/src/constants.ts index 14bf6be..b90570f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -14,26 +14,11 @@ export const LANDING_PAGE_DATA = { 'naddr1qvzqqqrkcgpzquuz5nxzzap2c034s8cuv5ayr7gjaxz7d22pgwfh0qpmsesy9eflqp4nxvp5xqer5den8qexzdrrvverzde5xfskxvm9xv6nsvtxx93nvdfnvy6rze3exyex2wfcx4jnvcfexscngveexvmnwwpsxd3rsd3kxq6ryef4xdnr5vrrvgmnjc33xuknwde4vskngvekxgknsenyxvkk2ctxvscrvenpvsmnxeqydygjx' ], featuredGames: [ - { - title: 'SUPERHOT', - imageUrl: '' - }, - { - title: 'The Bounce House', - imageUrl: '' - }, - { - title: 'Immortal Guns', - imageUrl: '' - }, - { - title: 'Magenta Horizon Act 1', - imageUrl: '' - }, - { - title: 'DEAD LETTER DEPT. Demo', - imageUrl: '' - } + 'Persona 3 Reload', + 'Caravan Sandwitch', + 'Cyberpunk 2077', + 'ELDEN RING', + 'FINAL FANTASY VII REMAKE INTERGRADE' ] } // we use this object to check if a user has reacted positively or negatively to a post diff --git a/src/layout/socialNav.tsx b/src/layout/socialNav.tsx index 855fe89..d010325 100644 --- a/src/layout/socialNav.tsx +++ b/src/layout/socialNav.tsx @@ -1,15 +1,24 @@ import { useState } from 'react' -import { Link } from 'react-router-dom' +import { Link, useLocation } from 'react-router-dom' import { appRoutes, getProfilePageRoute } from 'routes' import 'styles/socialNav.css' export const SocialNav = () => { + const location = useLocation() + const currentPath = location.pathname const [isCollapsed, setIsCollapsed] = useState(false) const toggleNav = () => { setIsCollapsed(!isCollapsed) } + const isOnHomePage = + currentPath === appRoutes.index || currentPath === appRoutes.home + const isOnSearchPage = currentPath === appRoutes.search + const isOnProfilePage = new RegExp( + `^${appRoutes.profile.replace(':nprofile', '[^/]+')}$` + ).test(currentPath) + return (
{
{!isCollapsed && (
- - - - - - + - - - - - + - - - - - + - - - - - + - - - - + isActive={isOnProfilePage} + svgPath='M256 288c79.53 0 144-64.47 144-144s-64.47-144-144-144c-79.52 0-144 64.47-144 144S176.5 288 256 288zM351.1 320H160c-88.36 0-160 71.63-160 160c0 17.67 14.33 32 31.1 32H480c17.67 0 31.1-14.33 31.1-32C512 391.6 440.4 320 351.1 320z' + />
)} -
{
) } + +interface NavButtonProps { + to: string + isActive: boolean + svgPath: string +} + +const NavButton = ({ to, isActive, svgPath }: NavButtonProps) => ( + + + + + +) diff --git a/src/pages/home.tsx b/src/pages/home.tsx index 072b6e9..a7b0f92 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -1,5 +1,5 @@ import { Filter, kinds, nip19 } from 'nostr-tools' -import { useState } from 'react' +import { useMemo, useState } from 'react' import { useNavigate } from 'react-router-dom' import { A11y, Navigation, Pagination, Autoplay } from 'swiper/modules' import { Swiper, SwiperSlide } from 'swiper/react' @@ -8,7 +8,7 @@ import { GameCard } from '../components/GameCard' import { ModCard } from '../components/ModCard' import { LANDING_PAGE_DATA } from '../constants' import { RelayController } from '../controllers' -import { useDidMount } from '../hooks' +import { useDidMount, useGames } from '../hooks' import { appRoutes, getModPageRoute } from '../routes' import { ModDetails } from '../types' import { @@ -30,6 +30,14 @@ import 'swiper/css/pagination' export const HomePage = () => { const navigate = useNavigate() + const games = useGames() + + const featuredGames = useMemo(() => { + return games.filter((game) => + LANDING_PAGE_DATA.featuredGames.includes(game['Game Name']) + ) + }, [games]) + return (
@@ -67,11 +75,11 @@ export const HomePage = () => {

Cool Games

- {LANDING_PAGE_DATA.featuredGames.map((game) => ( + {featuredGames.map((game) => ( ))}
diff --git a/src/pages/mods.tsx b/src/pages/mods.tsx index 7f9982c..8503802 100644 --- a/src/pages/mods.tsx +++ b/src/pages/mods.tsx @@ -6,14 +6,16 @@ import React, { useCallback, useEffect, useMemo, + useRef, useState } from 'react' +import { createSearchParams, useNavigate } from 'react-router-dom' import { LoadingSpinner } from '../components/LoadingSpinner' import { ModCard } from '../components/ModCard' import { MOD_FILTER_LIMIT } from '../constants' import { MetadataController } from '../controllers' import { useAppSelector, useDidMount, useMuteLists } from '../hooks' -import { getModPageRoute } from '../routes' +import { appRoutes, getModPageRoute } from '../routes' import '../styles/filters.css' import '../styles/pagination.css' import '../styles/search.css' @@ -227,6 +229,27 @@ export const ModsPage = () => { } const PageTitleRow = React.memo(() => { + const navigate = useNavigate() + const searchTermRef = useRef(null) + + const handleSearch = () => { + const value = searchTermRef.current?.value || '' // Access the input value from the ref + if (value !== '') { + const searchParams = createSearchParams({ + searchTerm: value, + searching: 'Mods' + }) + navigate({ pathname: appRoutes.search, search: `?${searchParams}` }) + } + } + + // Handle "Enter" key press inside the input + const handleKeyDown = (event: React.KeyboardEvent) => { + if (event.key === 'Enter') { + handleSearch() + } + } + return (
@@ -236,8 +259,19 @@ const PageTitleRow = React.memo(() => {
- - + {filterOptions.searching === SearchingFilterEnum.Mods && ( +
+
+ -
- {Object.values(SortByEnum).map((item, index) => ( -
- setFilterOptions((prev) => ({ - ...prev, - sort: item - })) - } - > - {item} -
- ))} -
-
-
-
-
- -
- {Object.values(ModeratedFilterEnum).map((item, index) => { - if (item === ModeratedFilterEnum.Unmoderated_Fully) { - const isAdmin = - userState.user?.npub === - import.meta.env.VITE_REPORTING_NPUB - - if (!isAdmin) return null - } - - return ( +
+ {Object.values(SortByEnum).map((item, index) => (
setFilterOptions((prev) => ({ ...prev, - moderated: item + sort: item })) } > {item}
- ) - })} + ))} +
-
+ )} + + {(filterOptions.searching === SearchingFilterEnum.Mods || + filterOptions.searching === SearchingFilterEnum.Users) && ( +
+
+ +
+ {Object.values(ModeratedFilterEnum).map((item, index) => { + if (item === ModeratedFilterEnum.Unmoderated_Fully) { + const isAdmin = + userState.user?.npub === + import.meta.env.VITE_REPORTING_NPUB + + if (!isAdmin) return null + } + + return ( +
+ setFilterOptions((prev) => ({ + ...prev, + moderated: item + })) + } + > + {item} +
+ ) + })} +
+
+
+ )} + + {filterOptions.searching === SearchingFilterEnum.Mods && ( +
+
+ +
+
+ setFilterOptions((prev) => ({ + ...prev, + source: window.location.host + })) + } + > + Show From: {window.location.host} +
+
+ setFilterOptions((prev) => ({ + ...prev, + source: 'Show All' + })) + } + > + Show All +
+
+
+
+ )} +