Skip to content

Commit

Permalink
Merge pull request #771 from alexstotsky/improve-movements-nav
Browse files Browse the repository at this point in the history
(improvement) Movements navigation
  • Loading branch information
ezewer authored Feb 20, 2024
2 parents 0e00ea4 + 1817c03 commit 1cccaa0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/components/Movements/Movements.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ class Movements extends PureComponent {
<SectionHeader
title={title}
target={TYPE}
showHeaderTabs
symbolsSelectorProps={{
currentFilters: targetSymbols,
existingCoins,
Expand Down
4 changes: 0 additions & 4 deletions src/components/Wallets/Wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ import {
} from 'ui/SectionHeader'
import QueryButton from 'ui/QueryButton'
import RefreshButton from 'ui/RefreshButton'
import SectionSwitch from 'ui/SectionSwitch'
import { isValidTimeStamp } from 'state/query/utils'
import queryConstants from 'state/query/constants'

import WalletsData from './Wallets.data'
import { propTypes, defaultProps } from './Wallets.props'

const isFrameworkMode = config.showFrameworkMode
const TYPE = queryConstants.MENU_WALLETS

class Wallets extends PureComponent {
constructor(props) {
Expand Down Expand Up @@ -116,7 +113,6 @@ class Wallets extends PureComponent {
<SectionHeaderTitle>
{t('navItems.myHistory.walletsTabs.balances')}
</SectionHeaderTitle>
<SectionSwitch target={TYPE} />
{isFrameworkMode && (
<SectionHeaderRow>
<SectionHeaderItem>
Expand Down
5 changes: 3 additions & 2 deletions src/ui/NavMenu/NavMenu.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ANALYSIS_STAT_TARGETS,
FUNDING_TARGETS,
EARNINGS_TARGETS,
WALLETS_TARGETS,
} from 'ui/SectionSwitch/SectionSwitch.helpers'

import constants from './NavMenu.constants'
Expand All @@ -22,6 +21,7 @@ const {
MENU_FPAYMENT,
MENU_INVOICES,
MENU_LEDGERS,
MENU_MOVEMENTS,
MENU_TRADES,
MENU_CANDLES,
MENU_ORDERS,
Expand Down Expand Up @@ -70,12 +70,13 @@ export const getSections = (menuType, isTurkishSite) => {
case MENU_MY_HISTORY:
return [
[MENU_LEDGERS, 'ledgers.title'],
[MENU_MOVEMENTS, 'movements.title'],
[[MENU_TRADES, MENU_CANDLES], 'trades.title'],
[[MENU_ORDERS, MENU_ORDER_TRADES], 'orders.title'],
[[MENU_POSITIONS, MENU_POSITIONS_ACTIVE, MENU_POSITIONS_AUDIT], 'positions.title'],
[MENU_FOFFER, 'navItems.myHistory.funding', isTurkishSite, FUNDING_TARGETS],
[MENU_FPAYMENT, 'navItems.myHistory.earnings', isTurkishSite, EARNINGS_TARGETS],
[MENU_WALLETS, 'wallets.title', false, WALLETS_TARGETS],
[MENU_WALLETS, 'wallets.title'],
]
case MENU_MERCHANT_HISTORY:
return [
Expand Down
17 changes: 0 additions & 17 deletions src/ui/SectionSwitch/SectionSwitch.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ export const EARNINGS_TARGETS = [
queryConstants.MENU_AFFILIATES_EARNINGS,
]

export const WALLETS_TARGETS = [
queryConstants.MENU_WALLETS,
queryConstants.MENU_MOVEMENTS,
]


export const ANALYSIS_STAT_SECTIONS = [
{
Expand Down Expand Up @@ -118,24 +113,12 @@ export const POSITIONS_SECTIONS = [
},
]

export const WALLETS_SECTIONS = [
{
targetSection: queryConstants.MENU_WALLETS,
description: 'navItems.myHistory.walletsTabs.balances',
},
{
targetSection: queryConstants.MENU_MOVEMENTS,
description: 'navItems.myHistory.walletsTabs.movements',
},
]

export const getSections = (target, hasSubSections) => {
if (_includes(TRADES_TARGETS, target) && hasSubSections) return TRADES_SECTIONS
if (_includes(POSITIONS_TARGETS, target) && hasSubSections) return POSITIONS_SECTIONS
if (_includes(ANALYSIS_STAT_TARGETS, target)) return ANALYSIS_STAT_SECTIONS
if (_includes(FUNDING_TARGETS, target)) return FUNDING_SECTIONS
if (_includes(EARNINGS_TARGETS, target)) return EARNINGS_SECTIONS
if (_includes(WALLETS_TARGETS, target)) return WALLETS_SECTIONS

return []
}
Expand Down

0 comments on commit 1cccaa0

Please sign in to comment.