diff --git a/src/typescript/frontend/src/components/pages/home/components/emoji-table/ClientGrid.tsx b/src/typescript/frontend/src/components/pages/home/components/emoji-table/ClientGrid.tsx index cd0eb6b9a..0dd2884ef 100644 --- a/src/typescript/frontend/src/components/pages/home/components/emoji-table/ClientGrid.tsx +++ b/src/typescript/frontend/src/components/pages/home/components/emoji-table/ClientGrid.tsx @@ -6,9 +6,8 @@ import { marketDataToProps } from "./utils"; import { useGridRowLength } from "./hooks/use-grid-items-per-line"; import { type MarketDataSortByHomePage } from "lib/queries/sorting/types"; import { useEffect, useMemo, useRef } from "react"; -import "./module.css"; -import { useEmojiPicker } from "context/emoji-picker-context"; import { type HomePageProps } from "app/home/HomePage"; +import "./module.css"; export const ClientGrid = ({ markets, @@ -20,11 +19,10 @@ export const ClientGrid = ({ sortBy: MarketDataSortByHomePage; }) => { const rowLength = useGridRowLength(); - const searchEmojis = useEmojiPicker((s) => s.emojis); const ordered = useMemo(() => { - return marketDataToProps(markets, searchEmojis); - }, [markets, searchEmojis]); + return marketDataToProps(markets); + }, [markets]); const initialRender = useRef(true); @@ -41,7 +39,7 @@ export const ClientGrid = ({ {ordered.map((v, i) => { return ( & { time: number; - searchEmojisKey: string; }; export type PropsWithTimeAndIndex = TableCardProps & { time: number; @@ -19,10 +18,7 @@ export type WithTimeIndexAndPrev = PropsWithTimeAndIndex & { const toSearchEmojisKey = (searchEmojis: string[]) => `{${searchEmojis.join("")}}`; -export const marketDataToProps = ( - markets: HomePageProps["markets"], - searchEmojis: string[] -): PropsWithTime[] => +export const marketDataToProps = (markets: HomePageProps["markets"]): PropsWithTime[] => markets.map((m) => ({ time: Number(m.market.time), symbol: m.market.symbolData.symbol, @@ -30,7 +26,6 @@ export const marketDataToProps = ( emojis: m.market.emojis, staticMarketCap: m.state.instantaneousStats.marketCap.toString(), staticVolume24H: m.dailyVolume.toString(), - searchEmojisKey: toSearchEmojisKey(searchEmojis), })); export const stateEventsToProps = ( @@ -103,7 +98,7 @@ export const constructOrdered = ({ // We don't need to filter the fetched data because it's already filtered and sorted by the // server. We only need to filter event store state events. const searchEmojis = getSearchEmojis() as Array; - const initial = marketDataToProps(markets, searchEmojis); + const initial = marketDataToProps(markets); // If we're sorting by bump order, deduplicate and sort the events by bump order. const bumps = stateEventsToProps(stateFirehose, getMarket, searchEmojis);