Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Aizad/Fix Derived toggle click on reload #7293

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 8 additions & 5 deletions src/javascript/app/pages/trade/markets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ class Markets extends React.Component {
};

toggleAccordion = () => {
this.setState({ open_accordion: !this.state.open_accordion });
this.setState((prevState) => ({
...prevState,
open_accordion: !prevState.open_accordion,
}));
}

getCurrentUnderlying = () => {
Expand Down Expand Up @@ -228,7 +231,6 @@ class Markets extends React.Component {
} else {
this.setState({
subgroup_active: false,
open_accordion : false,
});
}
}
Expand Down Expand Up @@ -536,11 +538,12 @@ class Markets extends React.Component {
>
<div
className={classNames('market', {
'active': subgroup_active,
'active' : subgroup_active,
'accordion-label': !!open_accordion,
})}
onClick={toggleAccordion || (subgroup_active ? toggleAccordion : '')}
onClick={toggleAccordion}
>
<span className={`icon synthetic_index ${open_accordion ? 'active' : ''}`} />
<span className={`icon synthetic_index ${subgroup_active ? 'active' : ''}`} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant we write this similar to line 541 using classNames function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resooolved 😩😩😩

<span>{group_markets[item].markets[0].subgroup_name}</span>
<span className={`accordion-icon icon ${open_accordion ? 'active' : ''}`} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resooolved 😩😩😩

</div>
Expand Down
5 changes: 5 additions & 0 deletions src/sass/app/components/market.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
display: flex;
flex-direction: column;

.accordion-label {
&:hover {
text-decoration: none;
}
}
.accordion-content {
flex-direction: column;
display: none;
Expand Down