Skip to content

Commit

Permalink
fix: wallet language filtering [Fixes #13385]
Browse files Browse the repository at this point in the history
  • Loading branch information
wackerow committed Jul 16, 2024
1 parent 7f09c30 commit 476b437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/hooks/useWalletTable.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useContext, useState } from "react"
import { useState } from "react"

import type { DropdownOption, Wallet, WalletFilter } from "@/lib/types"

import { WalletSupportedLanguageContext } from "@/contexts/WalletSupportedLanguageContext"

export type WalletMoreInfoData = Wallet & { moreInfo: boolean; key: string }

type UseWalletTableProps = {
walletData: Wallet[]
filters: WalletFilter
t: (x: string) => string
supportedLanguage: string
}

export const useWalletTable = ({
filters,
supportedLanguage,
t,
walletData,
}: UseWalletTableProps) => {
Expand Down Expand Up @@ -128,9 +128,6 @@ export const useWalletTable = ({
})
)

// Context API for language filter
const { supportedLanguage } = useContext(WalletSupportedLanguageContext)

const updateMoreInfo = (key) => {
const temp = [...walletCardData]

Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallets/find-wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const FindWalletPage = ({
filteredWallets,
updateMoreInfo,
walletCardData,
} = useWalletTable({ filters, t, walletData: wallets })
} = useWalletTable({ filters, supportedLanguage, t, walletData: wallets })

const updateFilterOption = (key) => {
const updatedFilters = { ...filters }
Expand Down

0 comments on commit 476b437

Please sign in to comment.