Skip to content

Commit

Permalink
[REF] top_bar: stop hard-coding height
Browse files Browse the repository at this point in the history
The top bar height is currently hard-coded. But in the next commit, we add
a ruban below the current top bar and it of course has a bigger height.

Task: 4357729
Part-of: #5284
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
  • Loading branch information
LucasLefevre committed Dec 11, 2024
1 parent 88fb112 commit 6bfcd98
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ css/* scss */ `
.o-topbar-composer {
height: fit-content;
margin-top: -1px;
margin-bottom: -1px;
border: 1px solid;
font-family: ${DEFAULT_FONT};
Expand Down
3 changes: 1 addition & 2 deletions src/components/spreadsheet/spreadsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
SEPARATOR_COLOR,
TEXT_BODY,
TEXT_BODY_MUTED,
TOPBAR_HEIGHT,
} from "../../constants";
import { batched } from "../../helpers";
import { ImageProvider } from "../../helpers/figures/images/image_provider";
Expand Down Expand Up @@ -365,7 +364,7 @@ export class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEnv
if (this.env.isDashboard()) {
properties["grid-template-rows"] = `auto`;
} else {
properties["grid-template-rows"] = `${TOPBAR_HEIGHT}px auto ${BOTTOMBAR_HEIGHT + 1}px`;
properties["grid-template-rows"] = `max-content auto ${BOTTOMBAR_HEIGHT + 1}px`;
}
properties["grid-template-columns"] = `auto ${this.sidePanel.panelSize}px`;

Expand Down
1 change: 0 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export const MIN_ROW_HEIGHT = 10;
export const MIN_COL_WIDTH = 5;
export const HEADER_HEIGHT = 26;
export const HEADER_WIDTH = 48;
export const TOPBAR_HEIGHT = 63;
export const TOPBAR_TOOLBAR_HEIGHT = 34;
export const BOTTOMBAR_HEIGHT = 36;
export const DEFAULT_CELL_WIDTH = 96;
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import {
MIN_ROW_HEIGHT,
PIVOT_TABLE_CONFIG,
SCROLLBAR_WIDTH,
TOPBAR_HEIGHT,
} from "./constants";
import { getFunctionsFromTokens } from "./formulas";
import { isEvaluationError, toBoolean, toJsDate, toNumber, toString } from "./functions/helpers";
Expand Down Expand Up @@ -238,7 +237,6 @@ export const SPREADSHEET_DIMENSIONS = {
MIN_COL_WIDTH,
HEADER_HEIGHT,
HEADER_WIDTH,
TOPBAR_HEIGHT,
BOTTOMBAR_HEIGHT,
DEFAULT_CELL_WIDTH,
DEFAULT_CELL_HEIGHT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Simple Spreadsheet Component simple rendering snapshot 1`] = `
<div
class="o-spreadsheet"
style="grid-template-rows:63px auto 37px; grid-template-columns:auto 350px; "
style="grid-template-rows:max-content auto 37px; grid-template-columns:auto 350px; "
>
<div
Expand Down

0 comments on commit 6bfcd98

Please sign in to comment.