Skip to content

Commit 16222bd

Browse files
committed
fix(calendar-web): styling, config
1 parent b7f3691 commit 16222bd

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

packages/pluggableWidgets/calendar-web/src/Calendar.editorConfig.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,17 @@ export function getProperties(values: CalendarPreviewProps, defaultProperties: P
4444
"customViewShowSunday"
4545
]);
4646
} else {
47-
hidePropertiesIn(defaultProperties, values, ["defaultViewStandard", "topBarDateFormat"]);
47+
hidePropertiesIn(defaultProperties, values, ["defaultViewStandard", "topBarDateFormat", "timeFormat"]);
4848
}
4949

5050
values.toolbarItems?.forEach((item, index) => {
5151
if (item.itemType === "title") {
52-
hideNestedPropertiesIn(defaultProperties, values, "toolbarItems", index, ["buttonTooltip", "buttonStyle"]);
52+
hideNestedPropertiesIn(defaultProperties, values, "toolbarItems", index, [
53+
"caption",
54+
"renderMode",
55+
"buttonTooltip",
56+
"buttonStyle"
57+
]);
5358
}
5459
// Hide all format properties for non-view items (navigation buttons, title)
5560
if (!["day", "month", "agenda", "week", "work_week"].includes(item.itemType)) {

packages/pluggableWidgets/calendar-web/src/components/Toolbar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function CustomToolbar({ label, localizer, onNavigate, onView, view, view
1313

1414
return (
1515
<div className="calendar-toolbar">
16-
<div className="btn-group">
16+
<div className="btn-group calendar-toolbar-left">
1717
<Button className="btn btn-default" onClick={handlePrev}>
1818
<IconInternal icon={{ type: "glyph", iconClass: "glyphicon-backward" }} />
1919
</Button>
@@ -25,11 +25,11 @@ export function CustomToolbar({ label, localizer, onNavigate, onView, view, view
2525
</Button>
2626
</div>
2727

28-
<div className="btn-group">
28+
<div className="btn-group calendar-toolbar-center">
2929
<span className="calendar-label">{label}</span>
3030
</div>
3131

32-
<div className="btn-group">
32+
<div className="btn-group calendar-toolbar-right">
3333
{Array.isArray(views) &&
3434
views.map(name => {
3535
return (
@@ -170,9 +170,9 @@ export function createConfigurableToolbar(items: ResolvedToolbarItem[]): (props:
170170

171171
return (
172172
<div className="calendar-toolbar">
173-
<div className="btn-group">{groups.left.map(renderItem)}</div>
174-
<div className="btn-group">{groups.center.map(renderItem)}</div>
175-
<div className="btn-group">{groups.right.map(renderItem)}</div>
173+
<div className="btn-group calendar-toolbar-left">{groups.left.map(renderItem)}</div>
174+
<div className="btn-group calendar-toolbar-center">{groups.center.map(renderItem)}</div>
175+
<div className="btn-group calendar-toolbar-right">{groups.right.map(renderItem)}</div>
176176
</div>
177177
);
178178
};

packages/pluggableWidgets/calendar-web/src/ui/Calendar.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,20 @@
4141
}
4242

4343
.calendar-toolbar {
44-
display: flex;
44+
display: grid;
45+
grid-template-columns: 1fr auto 1fr;
4546
align-items: center;
46-
justify-content: space-between;
47-
flex-wrap: wrap;
4847
padding-bottom: var(--spacing-medium, 10px);
48+
49+
&-left {
50+
justify-self: start;
51+
}
52+
&-center {
53+
justify-self: center;
54+
}
55+
&-right {
56+
justify-self: end;
57+
}
4958
}
5059

5160
.rbc-current-time-indicator {

0 commit comments

Comments
 (0)