Skip to content

Commit

Permalink
remove unwanted code
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidakanchwala committed Oct 22, 2024
1 parent ad0153d commit 4698a46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ export const FlowchartPrimaryToolbar = ({
ariaLabel={`Turn data layers ${visibleLayers ? 'off' : 'on'}`}
className={'pipeline-menu-button--layers'}
dataTest={`sidebar-flowchart-layers-btn-${visibleLayers}`}
disabled={disableLayerBtn}
icon={LayersIcon}
labelText={`${visibleLayers ? 'Hide' : 'Show'} layers`}
onClick={() => onToggleLayers(!disableLayerBtn)}
onClick={() => onToggleLayers(!visibleLayers)}
visible={display.layerBtn}
/>
<IconButton
Expand Down Expand Up @@ -102,7 +103,7 @@ export const FlowchartPrimaryToolbar = ({
};

export const mapStateToProps = (state) => ({
disableLayerBtn: state.layer.visible,
disableLayerBtn: !state.layer.ids.length,
textLabels: state.textLabels,
visible: state.visible,
display: state.display,
Expand Down
15 changes: 5 additions & 10 deletions src/components/flowchart/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,17 @@ export const drawLayers = function () {
* Render layer name labels
*/
export const drawLayerNames = function () {
const {
chartSize,
layers,
orientation
} = this.props;

const { chartSize, layers, orientation } = this.props;

// Calculate the layer name position based on orientation
const layerNamePosition = orientation
? chartSize.height - 100 || 0 // Vertical: position based on height
: chartSize.sidebarWidth || 0; // Horizontal: position based on sidebar width
? chartSize.height - 100 || 0 // Vertical: position based on height
: chartSize.sidebarWidth || 0; // Horizontal: position based on sidebar width

// Apply the correct translation based on orientation
const transformValue = orientation
? `translateY(${layerNamePosition}px)` // Vertical: use translateY
: `translateX(${layerNamePosition}px)`; // Horizontal: use translateX
? `translateY(${layerNamePosition}px)` // Vertical: use translateY
: `translateX(${layerNamePosition}px)`; // Horizontal: use translateX

this.el.layerNameGroup
.transition('layer-names-sidebar-width')
Expand Down

0 comments on commit 4698a46

Please sign in to comment.