Skip to content

Commit

Permalink
feat(panel): 14327 - Arrow in the "Analytics" tab is in the incorrect…
Browse files Browse the repository at this point in the history
… position at the initiate state
  • Loading branch information
propakov committed Jan 23, 2023
1 parent 9afe870 commit 73fc98d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/hooks/useShortPanelState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ export const useShortPanelState = (props?: UseShortPanelStateProps) => {
if (skipShortState) {
const singleControl: PanelCustomControl[] = [
{
icon: panelState === 'full' ? <ChevronUp24 /> : <ChevronDown24 />,
onWrapperClick: () =>
setPanelState((prevState) => (prevState === 'closed' ? 'full' : 'closed')),
icon: panelState === initialState ? <ChevronUp24 /> : <ChevronDown24 />,
onWrapperClick: () => {
const nextState = initialState === 'closed' ? 'full' : initialState;
setPanelState((prevState) => (prevState === 'closed' ? nextState : 'closed'));
},
},
];
// hooks must not be skipped - therefore it's late return
Expand Down

0 comments on commit 73fc98d

Please sign in to comment.