Skip to content

Commit

Permalink
fix: clean dashboard bar height calculation function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharmyn28 committed Feb 9, 2021
1 parent 99dea63 commit 71bb64d
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/components/ControlBar/DashboardsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,8 @@ const DashboardsBar = ({
const viewableRows =
isSmallScreen(width) && !isMaxHeight() ? MIN_ROW_COUNT : rows

const getHeight = () => {
return getControlBarHeight(viewableRows)
}

const getContainerHeight = () => {
return getRowsHeight(viewableRows) + FIRST_ROW_PADDING_HEIGHT
const rowHeightProp = {
height: getRowsHeight(viewableRows) + FIRST_ROW_PADDING_HEIGHT,
}

const getDashboardChips = () => {
Expand All @@ -130,10 +126,7 @@ const DashboardsBar = ({
isMaxHeight() ? classes.expanded : classes.collapsed
)
return (
<div
className={chipContainerClasses}
style={{ height: getContainerHeight() }}
>
<div className={chipContainerClasses} style={rowHeightProp}>
{chips}
</div>
)
Expand All @@ -150,18 +143,12 @@ const DashboardsBar = ({
return (
<>
<ControlBar
height={getHeight()}
height={getControlBarHeight(viewableRows)}
onChangeHeight={!isSmallScreen(width) ? adjustHeight : null}
onEndDrag={onEndDrag}
isMaxHeight={isMaxHeight()}
>
<div
className={containerClass}
ref={ref}
style={{
height: getContainerHeight(),
}}
>
<div className={containerClass} ref={ref} style={rowHeightProp}>
<div className={classes.controls}>
<Link
className={classes.newLink}
Expand Down

0 comments on commit 71bb64d

Please sign in to comment.