Skip to content

Commit

Permalink
(fix) TradingStatePanel: unable to remove panel (#690)
Browse files Browse the repository at this point in the history
* TradingStatePanel: able to remove panel

* fix issue with app freeze on add new panels
  • Loading branch information
dmytroshch authored Sep 11, 2023
1 parent dad5a12 commit 51a01fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/TradingStatePanel/TradingStatePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ const TradingStatePanel = ({
className='hfui-tradingstatepanel__wrapper'
moveable={moveable}
removeable={removeable}
onRemove={onRemove}
>
<OutsideClickHandler
onOutsideClick={() => isHistoryActive && setShowAOsHistory(false)}
>
<Panel
onRemove={onRemove}
darkHeader
moveable={false}
removeable={false}
Expand Down
3 changes: 3 additions & 0 deletions src/pages/MarketData/MarketData.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import './style.css'

const commonComponentProps = {
dark: true,
moveable: true,
removeable: true,
darkHeader: true,
showMarket: true,
canChangeMarket: true,
Expand All @@ -22,6 +24,7 @@ const MarketData = () => {
tradesProps={commonComponentProps}
bookProps={commonComponentProps}
chartProps={commonComponentProps}
sharedProps={commonComponentProps}
/>
</Layout.Main>
<Layout.Footer />
Expand Down
3 changes: 2 additions & 1 deletion src/redux/reducers/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,9 @@ function reducer(state = getInitialState(), action = {}) {
const layoutDef = getActiveLayoutDef(state)
const x = _min(_map(layoutDef.layout, l => l.x)) || 0
const y = _max(_map(layoutDef.layout, l => l.y)) || 0
const lastLayoutItemHeight = _get(layoutDef, 'layout[-1].h', 0)

const newY = y + layoutDef.layout[layoutDef?.layout?.length - 1]?.h
const newY = y + lastLayoutItemHeight

return {
...state,
Expand Down

0 comments on commit 51a01fb

Please sign in to comment.