diff --git a/components/TokenList.tsx b/components/TokenList.tsx index 1292630d..eb52600e 100644 --- a/components/TokenList.tsx +++ b/components/TokenList.tsx @@ -71,7 +71,7 @@ const TokenList = () => { return ( -
+
{ const [activeTab, setActiveTab] = useState('balances') @@ -32,9 +32,7 @@ const AccountTabs = () => { ['trade:positions', openPerpPositions.length], ['trade:orders', Object.values(openOrders).flat().length], ['trade:unsettled', unsettledTradeCount], - ['activity:activity', 0], - ['swap:swap-history', 0], - ['trade-history', 0], + ['history', 0], ] }, [openPerpPositions, unsettledPerpPositions, unsettledSpotBalances]) @@ -71,12 +69,8 @@ const TabContent = ({ activeTab }: { activeTab: string }) => { unsettledPerpPositions={unsettledPerpPositions} /> ) - case 'activity:activity': - return - case 'swap:swap-history': - return - case 'trade-history': - return + case 'history': + return default: return } diff --git a/components/account/ActivityFeed.tsx b/components/account/ActivityFeed.tsx index bed13b7d..e83575aa 100644 --- a/components/account/ActivityFeed.tsx +++ b/components/account/ActivityFeed.tsx @@ -1,106 +1,29 @@ -import MangoDateRangePicker from '@components/forms/DateRangePicker' -import Input from '@components/forms/Input' -import Label from '@components/forms/Label' -import MultiSelectDropdown from '@components/forms/MultiSelectDropdown' import { EXPLORERS } from '@components/settings/PreferredExplorerSettings' -import Button, { IconButton } from '@components/shared/Button' +import { IconButton } from '@components/shared/Button' import FormatNumericValue from '@components/shared/FormatNumericValue' -import Tooltip from '@components/shared/Tooltip' -import { Disclosure } from '@headlessui/react' -import { - AdjustmentsVerticalIcon, - ArrowLeftIcon, - ArrowPathIcon, - ChevronDownIcon, - ChevronRightIcon, -} from '@heroicons/react/20/solid' +import { ArrowLeftIcon } from '@heroicons/react/20/solid' import mangoStore, { LiquidationFeedItem } from '@store/mangoStore' import dayjs from 'dayjs' import useLocalStorageState from 'hooks/useLocalStorageState' -import useMangoAccount from 'hooks/useMangoAccount' -import useMangoGroup from 'hooks/useMangoGroup' import { useTranslation } from 'next-i18next' import Image from 'next/legacy/image' -import { ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react' +import { useState } from 'react' import { PREFERRED_EXPLORER_KEY } from 'utils/constants' import ActivityFeedTable from './ActivityFeedTable' -interface AdvancedFilters { - symbol: string[] - 'start-date': string - 'end-date': string - 'usd-lower': string - 'usd-upper': string -} - -const DEFAULT_ADVANCED_FILTERS = { - symbol: [], - 'start-date': '', - 'end-date': '', - 'usd-lower': '', - 'usd-upper': '', -} - -const DEFAULT_PARAMS = [ - 'deposit', - 'perp_trade', - 'liquidate_token_with_token', - 'openbook_trade', - 'swap', - 'withdraw', -] - const ActivityFeed = () => { const activityFeed = mangoStore((s) => s.activityFeed.feed) - const actions = mangoStore.getState().actions - const { mangoAccountAddress } = useMangoAccount() const [showActivityDetail, setShowActivityDetail] = useState(null) - const [advancedFilters, setAdvancedFilters] = useState( - DEFAULT_ADVANCED_FILTERS - ) - const [params, setParams] = useState(DEFAULT_PARAMS) - - useEffect(() => { - if (mangoAccountAddress) { - actions.fetchActivityFeed(mangoAccountAddress) - } - }, [actions, mangoAccountAddress]) const handleShowActivityDetails = (activity: any) => { setShowActivityDetail(activity) } - const advancedParamsString = useMemo(() => { - let advancedParams = '' - Object.entries(advancedFilters).map((entry) => { - if (entry[1].length) { - advancedParams = advancedParams + `&${entry[0]}=${entry[1]}` - } - }) - return advancedParams - }, [advancedFilters]) - - const queryParams = useMemo(() => { - return !params.length || params.length === 6 - ? advancedParamsString - : `&activity-type=${params.toString()}${advancedParamsString}` - }, [advancedParamsString, params]) - return !showActivityDetail ? ( - <> - - - + ) : ( { export default ActivityFeed -const ActivityFilters = ({ - filters, - setFilters, - params, - advancedFilters, - setAdvancedFilters, -}: { - filters: string[] - setFilters: (x: string[]) => void - params: string - advancedFilters: AdvancedFilters - setAdvancedFilters: (x: AdvancedFilters) => void -}) => { - const { t } = useTranslation(['common', 'activity']) - const actions = mangoStore.getState().actions - const loadActivityFeed = mangoStore((s) => s.activityFeed.loading) - const { mangoAccountAddress } = useMangoAccount() - const [showMobileFilters, setShowMobileFilters] = useState(false) - const [hasFilters, setHasFilters] = useState(false) - - const handleUpdateResults = useCallback(() => { - const set = mangoStore.getState().set - if (params) { - setHasFilters(true) - } else { - setHasFilters(false) - } - set((s) => { - s.activityFeed.feed = [] - s.activityFeed.loading = true - }) - if (mangoAccountAddress) { - actions.fetchActivityFeed(mangoAccountAddress, 0, params) - } - }, [actions, params, mangoAccountAddress]) - - const handleResetFilters = useCallback(async () => { - const set = mangoStore.getState().set - setHasFilters(false) - set((s) => { - s.activityFeed.feed = [] - s.activityFeed.loading = true - }) - if (mangoAccountAddress) { - await actions.fetchActivityFeed(mangoAccountAddress) - setAdvancedFilters(DEFAULT_ADVANCED_FILTERS) - setFilters(DEFAULT_PARAMS) - } - }, [actions, mangoAccountAddress]) - - const handleUpdateMobileResults = () => { - handleUpdateResults() - setShowMobileFilters(false) - } - - return mangoAccountAddress ? ( - -
- {hasFilters ? ( -
- - handleResetFilters()} - size="small" - > - - - -
- ) : null} -
setShowMobileFilters(!showMobileFilters)} - role="button" - className={`default-transition h-12 w-full bg-th-bkg-2 px-4 hover:bg-th-bkg-3 md:px-6`} - > - -
- - - {t('activity:filter-results')} - -
- -
-
-
- - - - -
- ) : null -} - -interface FiltersFormProps { - advancedFilters: any - setAdvancedFilters: (x: any) => void - filters: string[] - setFilters: (x: string[]) => void -} - -const FiltersForm = ({ - advancedFilters, - setAdvancedFilters, - filters, - setFilters, -}: FiltersFormProps) => { - const { t } = useTranslation(['common', 'activity']) - const { group } = useMangoGroup() - const [dateFrom, setDateFrom] = useState(null) - const [dateTo, setDateTo] = useState(null) - const [valueFrom, setValueFrom] = useState(advancedFilters['usd-lower'] || '') - const [valueTo, setValueTo] = useState(advancedFilters['usd-upper'] || '') - - const symbols = useMemo(() => { - if (!group) return [] - return Array.from(group.banksMapByName, ([key]) => key) - }, [group]) - - useEffect(() => { - if (advancedFilters['start-date']) { - setDateFrom(new Date(advancedFilters['start-date'])) - } - if (advancedFilters['end-date']) { - setDateTo(new Date(advancedFilters['end-date'])) - } - }, []) - - const toggleTypeOption = (option: string) => { - if (filters.includes(option)) { - setFilters(filters.filter((opt) => opt !== option)) - } else { - setFilters(filters.concat(option)) - } - } - - const toggleSymbolOption = (option: string) => { - setAdvancedFilters((prevSelected: any) => { - const newSelections = prevSelected.symbol ? [...prevSelected.symbol] : [] - if (newSelections.includes(option)) { - return { - ...prevSelected, - symbol: newSelections.filter((item) => item !== option), - } - } else { - newSelections.push(option) - return { ...prevSelected, symbol: newSelections } - } - }) - } - - useEffect(() => { - if (dateFrom && dateTo) { - setAdvancedFilters({ - ...advancedFilters, - 'start-date': dayjs(dateFrom).set('hour', 0).toISOString(), - 'end-date': dayjs(dateTo) - .set('hour', 23) - .set('minute', 59) - .toISOString(), - }) - } else { - setAdvancedFilters({ - ...advancedFilters, - 'start-date': '', - 'end-date': '', - }) - } - }, [dateFrom, dateTo]) - - useEffect(() => { - if (valueFrom && valueTo) { - setAdvancedFilters({ - ...advancedFilters, - 'usd-lower': Math.floor(valueFrom), - 'usd-upper': Math.ceil(valueTo), - }) - } else { - setAdvancedFilters({ - ...advancedFilters, - 'usd-lower': '', - 'usd-upper': '', - }) - } - }, [valueFrom, valueTo]) - - return ( - <> -
-
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
- - ) -} - const ActivityDetails = ({ activity, setShowActivityDetail, diff --git a/components/account/ActivityFeedTable.tsx b/components/account/ActivityFeedTable.tsx index f3abab84..75dcfabd 100644 --- a/components/account/ActivityFeedTable.tsx +++ b/components/account/ActivityFeedTable.tsx @@ -34,16 +34,15 @@ const formatFee = (value: number) => { const ActivityFeedTable = ({ activityFeed, handleShowActivityDetails, - params, }: { activityFeed: any handleShowActivityDetails: (x: LiquidationFeedItem) => void - params: string }) => { const { t } = useTranslation(['common', 'activity']) const { mangoAccountAddress } = useMangoAccount() - const actions = mangoStore.getState().actions + const actions = mangoStore((s) => s.actions) const loadActivityFeed = mangoStore((s) => s.activityFeed.loading) + const queryParams = mangoStore((s) => s.activityFeed.queryParams) const [offset, setOffset] = useState(0) const { connected } = useWallet() const [preferredExplorer] = useLocalStorageState( @@ -63,9 +62,9 @@ const ActivityFeedTable = ({ actions.fetchActivityFeed( mangoAccountAddress, offset + PAGINATION_PAGE_LENGTH, - params + queryParams ) - }, [actions, offset, params, mangoAccountAddress]) + }, [actions, offset, queryParams, mangoAccountAddress]) const getCreditAndDebit = (activity: any) => { const { activity_type } = activity @@ -197,7 +196,7 @@ const ActivityFeedTable = ({ <> {showTableView ? ( - +
{t('date')} diff --git a/components/account/ActivityFilters.tsx b/components/account/ActivityFilters.tsx new file mode 100644 index 00000000..1a42c1b7 --- /dev/null +++ b/components/account/ActivityFilters.tsx @@ -0,0 +1,332 @@ +import MangoDateRangePicker from '@components/forms/DateRangePicker' +import Input from '@components/forms/Input' +import Label from '@components/forms/Label' +import MultiSelectDropdown from '@components/forms/MultiSelectDropdown' +import Button, { IconButton } from '@components/shared/Button' +import Tooltip from '@components/shared/Tooltip' +import { Disclosure } from '@headlessui/react' +import { + AdjustmentsVerticalIcon, + ArrowPathIcon, + ChevronDownIcon, + ChevronRightIcon, +} from '@heroicons/react/20/solid' +import mangoStore from '@store/mangoStore' +import dayjs from 'dayjs' +import useMangoAccount from 'hooks/useMangoAccount' +import useMangoGroup from 'hooks/useMangoGroup' +import { useTranslation } from 'next-i18next' +import { ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react' + +interface AdvancedFilters { + symbol: string[] + 'start-date': string + 'end-date': string + 'usd-lower': string + 'usd-upper': string +} + +const DEFAULT_ADVANCED_FILTERS = { + symbol: [], + 'start-date': '', + 'end-date': '', + 'usd-lower': '', + 'usd-upper': '', +} + +const DEFAULT_PARAMS = [ + 'deposit', + 'perp_trade', + 'liquidate_token_with_token', + 'openbook_trade', + 'swap', + 'withdraw', +] + +const ActivityFilters = () => { + const actions = mangoStore((s) => s.actions) + const { mangoAccountAddress } = useMangoAccount() + const [advancedFilters, setAdvancedFilters] = useState( + DEFAULT_ADVANCED_FILTERS + ) + const [params, setParams] = useState(DEFAULT_PARAMS) + const { t } = useTranslation(['common', 'activity']) + const loadActivityFeed = mangoStore((s) => s.activityFeed.loading) + const [showFilters, setShowFilters] = useState(false) + const [hasFilters, setHasFilters] = useState(false) + + const advancedParamsString = useMemo(() => { + let advancedParams = '' + Object.entries(advancedFilters).map((entry) => { + if (entry[1].length) { + advancedParams = advancedParams + `&${entry[0]}=${entry[1]}` + } + }) + return advancedParams + }, [advancedFilters]) + + const queryParams = useMemo(() => { + return !params.length || params.length === 6 + ? advancedParamsString + : `&activity-type=${params.toString()}${advancedParamsString}` + }, [advancedParamsString, params]) + + useEffect(() => { + const set = mangoStore.getState().set + if (queryParams.length) { + set((state) => { + state.activityFeed.queryParams = queryParams + }) + } else { + set((state) => { + state.activityFeed.queryParams = '' + }) + } + }, [queryParams]) + + const handleUpdateResults = useCallback(() => { + const set = mangoStore.getState().set + if (queryParams) { + setHasFilters(true) + } else { + setHasFilters(false) + } + set((s) => { + s.activityFeed.feed = [] + s.activityFeed.loading = true + }) + if (mangoAccountAddress) { + actions.fetchActivityFeed(mangoAccountAddress, 0, queryParams) + } + }, [actions, queryParams, mangoAccountAddress]) + + const handleResetFilters = useCallback(async () => { + const set = mangoStore.getState().set + setHasFilters(false) + setShowFilters(false) + set((s) => { + s.activityFeed.feed = [] + s.activityFeed.loading = true + }) + if (mangoAccountAddress) { + await actions.fetchActivityFeed(mangoAccountAddress) + setAdvancedFilters(DEFAULT_ADVANCED_FILTERS) + setParams(DEFAULT_PARAMS) + } + }, [actions, mangoAccountAddress]) + + const handleUpdateMobileResults = () => { + handleUpdateResults() + setShowFilters(false) + } + + return mangoAccountAddress ? ( + +
+ {hasFilters ? ( + + handleResetFilters()} + size="small" + > + + + + ) : null} +
setShowFilters(!showFilters)} + role="button" + className={`default-transition mr-4 ml-3 rounded-md border border-th-button px-2 py-1.5 md:mr-6 md:hover:border-th-button-hover`} + > + +
+ + + {t('activity:filter-results')} + +
+ +
+
+
+ {showFilters ? ( + + + + + ) : null} +
+ ) : null +} + +export default ActivityFilters + +interface FiltersFormProps { + advancedFilters: any + setAdvancedFilters: (x: any) => void + filters: string[] + setFilters: (x: string[]) => void +} + +const FiltersForm = ({ + advancedFilters, + setAdvancedFilters, + filters, + setFilters, +}: FiltersFormProps) => { + const { t } = useTranslation(['common', 'activity']) + const { group } = useMangoGroup() + const [dateFrom, setDateFrom] = useState(null) + const [dateTo, setDateTo] = useState(null) + const [valueFrom, setValueFrom] = useState(advancedFilters['usd-lower'] || '') + const [valueTo, setValueTo] = useState(advancedFilters['usd-upper'] || '') + + const symbols = useMemo(() => { + if (!group) return [] + return Array.from(group.banksMapByName, ([key]) => key) + }, [group]) + + useEffect(() => { + if (advancedFilters['start-date']) { + setDateFrom(new Date(advancedFilters['start-date'])) + } + if (advancedFilters['end-date']) { + setDateTo(new Date(advancedFilters['end-date'])) + } + }, []) + + const toggleTypeOption = (option: string) => { + if (filters.includes(option)) { + setFilters(filters.filter((opt) => opt !== option)) + } else { + setFilters(filters.concat(option)) + } + } + + const toggleSymbolOption = (option: string) => { + setAdvancedFilters((prevSelected: any) => { + const newSelections = prevSelected.symbol ? [...prevSelected.symbol] : [] + if (newSelections.includes(option)) { + return { + ...prevSelected, + symbol: newSelections.filter((item) => item !== option), + } + } else { + newSelections.push(option) + return { ...prevSelected, symbol: newSelections } + } + }) + } + + useEffect(() => { + if (dateFrom && dateTo) { + setAdvancedFilters({ + ...advancedFilters, + 'start-date': dayjs(dateFrom).set('hour', 0).toISOString(), + 'end-date': dayjs(dateTo) + .set('hour', 23) + .set('minute', 59) + .toISOString(), + }) + } else { + setAdvancedFilters({ + ...advancedFilters, + 'start-date': '', + 'end-date': '', + }) + } + }, [dateFrom, dateTo]) + + useEffect(() => { + if (valueFrom && valueTo) { + setAdvancedFilters({ + ...advancedFilters, + 'usd-lower': Math.floor(valueFrom), + 'usd-upper': Math.ceil(valueTo), + }) + } else { + setAdvancedFilters({ + ...advancedFilters, + 'usd-lower': '', + 'usd-upper': '', + }) + } + }, [valueFrom, valueTo]) + + return ( + <> +
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+ + ) +} diff --git a/components/account/HistoryTabs.tsx b/components/account/HistoryTabs.tsx new file mode 100644 index 00000000..c4583184 --- /dev/null +++ b/components/account/HistoryTabs.tsx @@ -0,0 +1,62 @@ +import { useEffect, useState } from 'react' +import SwapHistoryTable from '../swap/SwapHistoryTable' +import ActivityFeed from './ActivityFeed' +import TradeHistory from '@components/trade/TradeHistory' +import { useTranslation } from 'next-i18next' +import ActivityFilters from './ActivityFilters' +import mangoStore from '@store/mangoStore' +import useMangoAccount from 'hooks/useMangoAccount' + +const TABS = ['activity:activity', 'activity:swaps', 'activity:trades'] + +const HistoryTabs = () => { + const { t } = useTranslation(['common', 'activity']) + const [activeTab, setActiveTab] = useState('activity:activity') + const actions = mangoStore((s) => s.actions) + const { mangoAccountAddress } = useMangoAccount() + + useEffect(() => { + if (actions && mangoAccountAddress) { + actions.fetchActivityFeed(mangoAccountAddress) + } + }, [actions, mangoAccountAddress]) + + return ( + <> +
+
+ {TABS.map((tab) => ( + + ))} +
+ {activeTab === 'activity:activity' ? : null} +
+ + + ) +} + +const TabContent = ({ activeTab }: { activeTab: string }) => { + switch (activeTab) { + case 'activity:activity': + return + case 'activity:swaps': + return + case 'activity:trades': + return + default: + return + } +} + +export default HistoryTabs diff --git a/pages/index.tsx b/pages/index.tsx index e80e50e7..898a26f8 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -25,7 +25,7 @@ export async function getStaticProps({ locale }: { locale: string }) { const Index: NextPage = () => { return ( -
+
) diff --git a/public/locales/en/activity.json b/public/locales/en/activity.json index 7309d734..86866c93 100644 --- a/public/locales/en/activity.json +++ b/public/locales/en/activity.json @@ -1,5 +1,5 @@ { - "activity": "Activity", + "activity": "Activity Feed", "activity-type": "Activity Type", "activity-value": "Activity Value", "advanced-filters": "Advanced Filters", @@ -10,7 +10,7 @@ "debit": "Debit", "deposit": "Deposit", "deposits": "Deposits", - "filter-results": "Filter Results", + "filter-results": "Filter", "liquidation": "Liquidation", "liquidation-type": "Liquidation Type", "liquidations": "Liquidations", @@ -26,6 +26,7 @@ "swap": "Swap", "swaps": "Swaps", "tooltip-fee": "Swap fees paid to other DEXs are not displayed", + "trades": "Trades", "update": "Update", "value-from": "Value From", "value-to": "Value To", diff --git a/public/locales/en/common.json b/public/locales/en/common.json index ed113969..e927842a 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -71,6 +71,7 @@ "health": "Health", "health-impact": "Health Impact", "health-tooltip": "Projects the health of your account before you make a trade. The first value is your current account health and the second your projected account health.", + "history": "History", "insufficient-sol": "Solana requires 0.0432 SOL rent to create a Mango Account. This will be returned if you close your account.", "interest-earned": "Interest Earned", "interest-earned-paid": "Interest Earned", diff --git a/public/locales/es/activity.json b/public/locales/es/activity.json index 7309d734..86866c93 100644 --- a/public/locales/es/activity.json +++ b/public/locales/es/activity.json @@ -1,5 +1,5 @@ { - "activity": "Activity", + "activity": "Activity Feed", "activity-type": "Activity Type", "activity-value": "Activity Value", "advanced-filters": "Advanced Filters", @@ -10,7 +10,7 @@ "debit": "Debit", "deposit": "Deposit", "deposits": "Deposits", - "filter-results": "Filter Results", + "filter-results": "Filter", "liquidation": "Liquidation", "liquidation-type": "Liquidation Type", "liquidations": "Liquidations", @@ -26,6 +26,7 @@ "swap": "Swap", "swaps": "Swaps", "tooltip-fee": "Swap fees paid to other DEXs are not displayed", + "trades": "Trades", "update": "Update", "value-from": "Value From", "value-to": "Value To", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index e9071529..3e528707 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -71,6 +71,7 @@ "health": "Health", "health-impact": "Health Impact", "health-tooltip": "Projects the health of your account before you make a trade. The first value is your current account health and the second your projected account health.", + "history": "History", "insufficient-sol": "Solana requires 0.0432 SOL rent to create a Mango Account. This will be returned if you close your account.", "interest-earned": "Interest Earned", "interest-earned-paid": "Interest Earned", diff --git a/public/locales/ru/activity.json b/public/locales/ru/activity.json index 7309d734..86866c93 100644 --- a/public/locales/ru/activity.json +++ b/public/locales/ru/activity.json @@ -1,5 +1,5 @@ { - "activity": "Activity", + "activity": "Activity Feed", "activity-type": "Activity Type", "activity-value": "Activity Value", "advanced-filters": "Advanced Filters", @@ -10,7 +10,7 @@ "debit": "Debit", "deposit": "Deposit", "deposits": "Deposits", - "filter-results": "Filter Results", + "filter-results": "Filter", "liquidation": "Liquidation", "liquidation-type": "Liquidation Type", "liquidations": "Liquidations", @@ -26,6 +26,7 @@ "swap": "Swap", "swaps": "Swaps", "tooltip-fee": "Swap fees paid to other DEXs are not displayed", + "trades": "Trades", "update": "Update", "value-from": "Value From", "value-to": "Value To", diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index e9071529..3e528707 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -71,6 +71,7 @@ "health": "Health", "health-impact": "Health Impact", "health-tooltip": "Projects the health of your account before you make a trade. The first value is your current account health and the second your projected account health.", + "history": "History", "insufficient-sol": "Solana requires 0.0432 SOL rent to create a Mango Account. This will be returned if you close your account.", "interest-earned": "Interest Earned", "interest-earned-paid": "Interest Earned", diff --git a/public/locales/zh/activity.json b/public/locales/zh/activity.json index 7309d734..86866c93 100644 --- a/public/locales/zh/activity.json +++ b/public/locales/zh/activity.json @@ -1,5 +1,5 @@ { - "activity": "Activity", + "activity": "Activity Feed", "activity-type": "Activity Type", "activity-value": "Activity Value", "advanced-filters": "Advanced Filters", @@ -10,7 +10,7 @@ "debit": "Debit", "deposit": "Deposit", "deposits": "Deposits", - "filter-results": "Filter Results", + "filter-results": "Filter", "liquidation": "Liquidation", "liquidation-type": "Liquidation Type", "liquidations": "Liquidations", @@ -26,6 +26,7 @@ "swap": "Swap", "swaps": "Swaps", "tooltip-fee": "Swap fees paid to other DEXs are not displayed", + "trades": "Trades", "update": "Update", "value-from": "Value From", "value-to": "Value To", diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index e9071529..3e528707 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -71,6 +71,7 @@ "health": "Health", "health-impact": "Health Impact", "health-tooltip": "Projects the health of your account before you make a trade. The first value is your current account health and the second your projected account health.", + "history": "History", "insufficient-sol": "Solana requires 0.0432 SOL rent to create a Mango Account. This will be returned if you close your account.", "interest-earned": "Interest Earned", "interest-earned-paid": "Interest Earned", diff --git a/public/locales/zh_tw/activity.json b/public/locales/zh_tw/activity.json index 7309d734..86866c93 100644 --- a/public/locales/zh_tw/activity.json +++ b/public/locales/zh_tw/activity.json @@ -1,5 +1,5 @@ { - "activity": "Activity", + "activity": "Activity Feed", "activity-type": "Activity Type", "activity-value": "Activity Value", "advanced-filters": "Advanced Filters", @@ -10,7 +10,7 @@ "debit": "Debit", "deposit": "Deposit", "deposits": "Deposits", - "filter-results": "Filter Results", + "filter-results": "Filter", "liquidation": "Liquidation", "liquidation-type": "Liquidation Type", "liquidations": "Liquidations", @@ -26,6 +26,7 @@ "swap": "Swap", "swaps": "Swaps", "tooltip-fee": "Swap fees paid to other DEXs are not displayed", + "trades": "Trades", "update": "Update", "value-from": "Value From", "value-to": "Value To", diff --git a/public/locales/zh_tw/common.json b/public/locales/zh_tw/common.json index e9071529..3e528707 100644 --- a/public/locales/zh_tw/common.json +++ b/public/locales/zh_tw/common.json @@ -71,6 +71,7 @@ "health": "Health", "health-impact": "Health Impact", "health-tooltip": "Projects the health of your account before you make a trade. The first value is your current account health and the second your projected account health.", + "history": "History", "insufficient-sol": "Solana requires 0.0432 SOL rent to create a Mango Account. This will be returned if you close your account.", "interest-earned": "Interest Earned", "interest-earned-paid": "Interest Earned", diff --git a/store/mangoStore.ts b/store/mangoStore.ts index cface1c6..7cc5a00e 100644 --- a/store/mangoStore.ts +++ b/store/mangoStore.ts @@ -236,6 +236,7 @@ export type MangoStore = { activityFeed: { feed: Array loading: boolean + queryParams: string } connected: boolean connection: Connection @@ -381,6 +382,7 @@ const mangoStore = create()( activityFeed: { feed: [], loading: true, + queryParams: '', }, connected: false, connection, @@ -589,11 +591,8 @@ const mangoStore = create()( set((state) => { state.activityFeed.feed = combinedFeed }) - } catch { - notify({ - title: 'Failed to fetch account activity feed', - type: 'error', - }) + } catch (e) { + console.log('Failed to fetch account activity feed', e) } finally { set((state) => { state.activityFeed.loading = false