Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(improvement) Movements navigation #771

Merged
merged 5 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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