Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add fixed heights for date picker and table header (month and buttons) #26932

Merged
merged 7 commits into from
Dec 16, 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.LemonCalendar {
--lemon-calendar-month-height: 305px;
--lemon-calendar-row-gap: 2px;
--lemon-calendar-day-width: 40px;
--lemon-calendar-today-radius: 2px;
Expand All @@ -7,6 +8,9 @@
// Tricky: needs to match the equivalent height button from LemonButton.scss
--lemon-calendar-time-button-height: 2.3125rem;

// Force height for month so when swtiching to longer months, the height doesn't change
height: var(--lemon-calendar-month-height);

.LemonCalendar__month {
width: 100%;
}
Expand All @@ -23,6 +27,10 @@
}

.LemonCalendar__month tr {
&.LemonCalendar__month-header {
height: var(--lemon-calendar-time-button-height);
}

.LemonButton {
&.rounded-none {
border-radius: 0;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const LemonCalendar = forwardRef(function LemonCalendar(
return (
<table className="LemonCalendar__month" key={month} data-attr="lemon-calendar-month">
<thead>
<tr>
<tr className="LemonCalendar__month-header">
<th className="relative">
{showLeftMonth && (
<LemonButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ Minute.args = { granularity: 'minute' }

export const WithTimeToggle: Story = BasicTemplate.bind({})
WithTimeToggle.args = { showTimeToggle: true }

export const WithTimeToggleAndMultipleMonths: Story = BasicTemplate.bind({})
WithTimeToggleAndMultipleMonths.args = { showTimeToggle: true, months: 3 }
Loading