Skip to content

Commit

Permalink
feat: hide single day header with css (#1019)
Browse files Browse the repository at this point in the history
* No longer hiding the header when we only show one day

* Now hiding header w/ css
  • Loading branch information
SudoPlz authored and jquense committed Nov 7, 2018
1 parent 0d5ed30 commit 5857d8f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/TimeGridHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,13 @@ class TimeGridHeader extends React.Component {
</div>
</div>
)}
{/* For rendering only one day no need to show the headers */}
{range.length > 1 && (
<div className="rbc-row rbc-time-header-cell">
{this.renderHeaderCells(range)}
</div>
)}
<div
className={`rbc-row rbc-time-header-cell${
range.length <= 1 ? ' rbc-time-header-cell-single-day' : ''
}`}
>
{this.renderHeaderCells(range)}
</div>
<DateContentRow
isAllDay
rtl={rtl}
Expand Down
4 changes: 4 additions & 0 deletions src/less/time-column.less
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
flex-basis: 0px;
}

.rbc-time-header-cell-single-day {
display: none;
}

.rbc-day-slot {
min-width: 140px;
}
Expand Down
4 changes: 4 additions & 0 deletions src/less/time-grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
// }
}

.rbc-time-header-cell-single-day {
display: none;
}

.rbc-time-header-content {
flex: 1;
display: flex;
Expand Down

0 comments on commit 5857d8f

Please sign in to comment.