|
1 |
| -import { Fragment, useEffect, useState } from 'react' |
| 1 | +import { Fragment, TransitionEvent, useEffect, useState } from 'react' |
2 | 2 |
|
3 | 3 | import { ReactComponent as ICSortArrowDown } from '@Icons/ic-sort-arrow-down.svg'
|
4 | 4 | import { ReactComponent as ICSort } from '@Icons/ic-arrow-up-down.svg'
|
@@ -29,8 +29,8 @@ export const DeploymentConfigDiffMain = ({
|
29 | 29 | })
|
30 | 30 | }
|
31 | 31 |
|
32 |
| - const handleTransitionEnd = () => { |
33 |
| - if (scrollIntoViewId) { |
| 32 | + const handleTransitionEnd = (id: string) => (e: TransitionEvent<HTMLDivElement>) => { |
| 33 | + if (e.target === e.currentTarget && scrollIntoViewId === id) { |
34 | 34 | const element = document.querySelector(`#${scrollIntoViewId}`)
|
35 | 35 | element?.scrollIntoView({ block: 'start' })
|
36 | 36 | }
|
@@ -63,6 +63,7 @@ export const DeploymentConfigDiffMain = ({
|
63 | 63 | ) : (
|
64 | 64 | configItem.text
|
65 | 65 | )}
|
| 66 | + {index !== list.length - 1 && <span className="cn-9 fs-13 lh-20">/</span>} |
66 | 67 | </Fragment>
|
67 | 68 | )
|
68 | 69 | }
|
@@ -122,7 +123,7 @@ export const DeploymentConfigDiffMain = ({
|
122 | 123 | isExpanded={expandedView[id]}
|
123 | 124 | hasDiff={hasDiff}
|
124 | 125 | onClick={handleAccordionClick(id)}
|
125 |
| - onTransitionEnd={handleTransitionEnd} |
| 126 | + onTransitionEnd={handleTransitionEnd(id)} |
126 | 127 | >
|
127 | 128 | {isDeploymentTemplate ? (
|
128 | 129 | <>
|
@@ -164,12 +165,12 @@ export const DeploymentConfigDiffMain = ({
|
164 | 165 | return (
|
165 | 166 | <div className="bcn-0 deployment-config-diff__main-top">
|
166 | 167 | <div className="dc__border-bottom-n1 flexbox dc__align-items-center dc__position-sticky dc__top-0 bcn-0 w-100 dc__zi-11">
|
167 |
| - <div className="flexbox dc__align-items-center p-12 dc__gap-4 deployment-config-diff__main-top__header"> |
| 168 | + <div className="flexbox dc__align-items-center p-12 dc__gap-8 deployment-config-diff__main-top__header"> |
168 | 169 | <p className="m-0 cn-9 fs-13 lh-20">{headerText}</p>
|
169 | 170 | {renderHeaderSelectors(selectorsConfig.primaryConfig)}
|
170 | 171 | </div>
|
171 | 172 | <div className="dc__border-left flexbox dc__align-items-center deployment-config-diff__main-top__header">
|
172 |
| - <div className="flex-grow-1 flexbox dc__align-items-center dc__gap-4 p-12"> |
| 173 | + <div className="flex-grow-1 flexbox dc__align-items-center dc__gap-8 p-12"> |
173 | 174 | {renderHeaderSelectors(selectorsConfig.secondaryConfig)}
|
174 | 175 | </div>
|
175 | 176 | {renderSortButton()}
|
|
0 commit comments