diff --git a/client/src/components/Home.tsx b/client/src/components/Home.tsx index aeccebd..bec1bcf 100644 --- a/client/src/components/Home.tsx +++ b/client/src/components/Home.tsx @@ -11,7 +11,7 @@ const Home = () => { // State declarations const [events, setEvents] = useState([]); const [filterDifficulty, setFilterDifficulty] = useState(localStorage.getItem("filterDifficulty") || "20"); - const [sortByPoW, setSortByPoW] = useState(true); + const [sortByTime, setSortByTime] = useState(true); // const [inBrowser, setInBrowser] = useState(false); // Removed as it's not being used // Function to handle new events @@ -50,7 +50,7 @@ const Home = () => { ) const toggleSort = () => { - setSortByPoW(prev => !prev); + setSortByTime(prev => !prev); }; // Events sorted by time @@ -59,7 +59,7 @@ const Home = () => { // Events sorted by PoW (assuming `getPow` returns a numerical representation of the PoW) const eventsSortedByPow = [...filteredEvents].sort((a, b) => getPow(b.id) - getPow(a.id)); - const displayedEvents = sortByPoW ? eventsSortedByPow : eventsSortedByTime; + const displayedEvents = sortByTime ? eventsSortedByTime : eventsSortedByPow; // Get metadata for an event const getMetadataEvent = (event: Event) => { @@ -84,17 +84,17 @@ const Home = () => { id="toggleB" type="checkbox" className="sr-only" - checked={sortByPoW} + checked={sortByTime} onChange={toggleSort} />
-
- {sortByPoW ? 'Sort by PoW' : 'Sort by recent'} +
+ {sortByTime ? 'Sort by recent' : 'Sort by PoW'}