diff --git a/src/components/assetsView/views/AssetGrid.tsx b/src/components/assetsView/views/AssetGrid.tsx index 930c9a6..167d124 100644 --- a/src/components/assetsView/views/AssetGrid.tsx +++ b/src/components/assetsView/views/AssetGrid.tsx @@ -40,7 +40,7 @@ export const AssetGrid: FC<{ realtokens: (UserRealtoken | RWARealtoken)[] }> = ( }, [props.realtokens, page, pageSize]) // Go to first page when data changes (e.g. search, filter, order, ...) - // useEffect(() => setPage(1), [props.realtokens]) + useEffect(() => setPage(1), [props.realtokens, pageSize]) const combobox = useCombobox({ onDropdownClose: () => combobox.resetSelectedOption(), diff --git a/src/i18next/locales/en/common.json b/src/i18next/locales/en/common.json index f5facca..32ee90b 100644 --- a/src/i18next/locales/en/common.json +++ b/src/i18next/locales/en/common.json @@ -3,6 +3,7 @@ "title": "Realtoken Dashboard", "transactions": "My transactions", "histories": "Changes history", + "yamStatistics": "Secondary market statistics (Yam)", "documentation": "Community Wiki", "home": "Home", "realt": "RealT", @@ -378,7 +379,15 @@ }, "yamStatisticsPage": { "home": "Home", - "title": "Secondary market statistics (Yam)" + "title": "Secondary market statistics (Yam)", + "filter": { + "field": "Filter", + "all": "All", + "owned": "My properties", + "subsidized": "Subsidized", + "fullySubsidized": "Fully subsidized", + "notSubsidized": "Not subsidized" + } }, "initialTransfersLoader": { "title": "Initial data loading", diff --git a/src/i18next/locales/fr/common.json b/src/i18next/locales/fr/common.json index f5bdbfa..096f2d4 100644 --- a/src/i18next/locales/fr/common.json +++ b/src/i18next/locales/fr/common.json @@ -3,6 +3,7 @@ "title": "Realtoken Dashboard", "transactions": "Mes transactions", "histories": "Historique des changements", + "yamStatistics": "Statistiques marché secondaire (Yam)", "documentation": "Wiki communautaire", "home": "Accueil", "realt": "RealT", @@ -379,7 +380,15 @@ }, "yamStatisticsPage": { "home": "Accueil", - "title": "Statistiques marché secondaire (Yam)" + "title": "Statistiques marché secondaire (Yam)", + "filter": { + "field": "Filtre", + "all": "Toutes les propriétés", + "owned": "Mes propriétés", + "subsidized": "Subventionnés", + "fullySubsidized": "Entièrement subventionnés", + "notSubsidized": "Non subventionnés" + } }, "initialTransfersLoader": { "title": "Chargement initial des données", diff --git a/src/pages/yamStatistics.tsx b/src/pages/yamStatistics.tsx index 86f7cd8..dba6596 100644 --- a/src/pages/yamStatistics.tsx +++ b/src/pages/yamStatistics.tsx @@ -11,8 +11,11 @@ import { Flex, Group, Pagination, + Select, } from '@mantine/core' +import { AssetSubsidyType } from 'src/components/assetsView' +import { useInputStyles } from 'src/components/inputs/useInputStyles' import { useCurrencyValue } from 'src/hooks/useCurrencyValue' import { GetYamStatistics, YamStatistics } from 'src/repositories' import { @@ -22,14 +25,16 @@ import { const YamStatisticsRow: React.FC<{ statistics: YamStatistics - realtoken: UserRealtoken + realtoken: UserRealtoken | null }> = ({ statistics, realtoken }) => { + if (!realtoken) return null const { t: tNumbers } = useTranslation('common', { keyPrefix: 'numbers' }) const yamPrice = statistics.volume / statistics.quantity const yamDifference = yamPrice - realtoken.tokenPrice const yamDifferencePercent = (yamDifference / realtoken.tokenPrice) * 100 const fallback = '-' + const tokenPriceValue = useCurrencyValue(realtoken.tokenPrice, fallback) const yamPriceValue = useCurrencyValue(yamPrice, fallback) const yamDifferenceValue = useCurrencyValue(yamDifference, fallback) const volumeValue = useCurrencyValue(statistics.volume, fallback) @@ -38,7 +43,7 @@ const YamStatisticsRow: React.FC<{ <>