Skip to content

Commit

Permalink
feat: open Panels on diff - refs #256378
Browse files Browse the repository at this point in the history
* open panles on diff

* use const variable

---------

Co-authored-by: David Ichim <ichim.david@gmail.com>
  • Loading branch information
dobri1408 and ichim-david committed Aug 29, 2023
1 parent 0a72a32 commit 47cfb04
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/manage/Blocks/Accordion/View.jsx
Expand Up @@ -22,6 +22,12 @@ const View = (props) => {
const history = useHistory();
const panels = getPanels(data.data);
const metadata = props.metadata || props.properties;
const diffView =
location?.pathname.slice(
location?.pathname.lastIndexOf('/'),
location?.pathname.length,
) === '/diff';

const [activeIndex, setActiveIndex] = React.useState([]);
const [activePanel, setActivePanel] = React.useState([]);
const [filterValue, setFilterValue] = React.useState('');
Expand Down Expand Up @@ -181,15 +187,15 @@ const View = (props) => {
<AnimateHeight
animateOpacity
duration={500}
height={active ? 'auto' : 0}
height={active || diffView ? 'auto' : 0}
onTransitionEnd={() => {
if (!!activePanels && id === itemToScroll) {
scrollToElement();
setItemToScroll('');
}
}}
>
<Accordion.Content active={active}>
<Accordion.Content active={diffView ? true : active}>
<RenderBlocks
{...props}
location={location}
Expand Down

0 comments on commit 47cfb04

Please sign in to comment.