Skip to content

Commit

Permalink
fix: rtl incorrectly named or not propagated (jquense#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtursky authored and jquense committed Jun 10, 2019
1 parent 762e8cf commit caa863f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ class Calendar extends React.Component {
return (
<div
{...elementProps}
className={cn(className, 'rbc-calendar', props.rtl && 'rbc-is-rtl')}
className={cn(className, 'rbc-calendar', props.rtl && 'rbc-rtl')}
style={style}
>
{toolbar && (
Expand Down
4 changes: 2 additions & 2 deletions src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class DayColumn extends React.Component {
renderEvents = () => {
let {
events,
rtl: isRtl,
rtl,
selected,
accessors,
localizer,
Expand Down Expand Up @@ -219,7 +219,7 @@ class DayColumn extends React.Component {
label={label}
key={'evt_' + idx}
getters={getters}
isRtl={isRtl}
rtl={rtl}
components={components}
continuesEarlier={continuesEarlier}
continuesLater={continuesLater}
Expand Down
2 changes: 2 additions & 0 deletions src/TimeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export default class TimeGrid extends Component {
events,
range,
width,
rtl,
selected,
getNow,
resources,
Expand Down Expand Up @@ -192,6 +193,7 @@ export default class TimeGrid extends Component {
range={range}
events={allDayEvents}
width={width}
rtl={rtl}
getNow={getNow}
localizer={localizer}
selected={selected}
Expand Down
4 changes: 2 additions & 2 deletions src/TimeGridEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function TimeGridEvent(props) {
className,
event,
accessors,
isRtl,
rtl,
selected,
label,
continuesEarlier,
Expand Down Expand Up @@ -44,7 +44,7 @@ function TimeGridEvent(props) {
...userProps.style,
top: `${top}%`,
height: `${height}%`,
[isRtl ? 'right' : 'left']: `${Math.max(0, xOffset)}%`,
[rtl ? 'right' : 'left']: `${Math.max(0, xOffset)}%`,
width: `${width}%`,
}}
title={
Expand Down
2 changes: 1 addition & 1 deletion src/less/time-column.less
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
margin-right: 10px;
top: 0;

&.rbc-is-rtl {
&.rbc-rtl {
left: 10px;
right: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sass/time-column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
margin-right: 10px;
top: 0;

&.rbc-is-rtl {
&.rbc-rtl {
left: 10px;
right: 0;
}
Expand Down

0 comments on commit caa863f

Please sign in to comment.