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

Make popover flexible #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions src/EventItemPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,43 @@ class EventItemPopover extends Component {
);
}

let colorRow = config.eventItemPopoverShowColor ? (
<Col span={2}>
<div
className="status-dot"
style={{ backgroundColor: statusColor }}
/>
</Col>
) : null;

let dateFormat = config.eventItemPopoverDateFormat;

let dateTimeRow = (
<Col span={22}>
<span className="header1-text">{start.format("HH:mm")}</span>
{dateFormat && (
<span className="help-text" style={{ marginLeft: "8px" }}>
{start.format(dateFormat)}
</span>
)}
<span className="header2-text" style={{ marginLeft: "8px" }}>
-
</span>
<span className="header1-text" style={{ marginLeft: "8px" }}>
{end.format("HH:mm")}
</span>
{dateFormat && (
<span className="help-text" style={{ marginLeft: "8px" }}>
{end.format(dateFormat)}
</span>
)}
</Col>
);

return (
<div style={{width: '300px'}}>
<Row type="flex" align="middle">
<Col span={2}>
<div className="status-dot" style={{backgroundColor: statusColor}} />
</Col>
{colorRow}
<Col span={22} className="overflow-text">
<span className="header2-text" title={title}>{title}</span>
</Col>
Expand All @@ -104,9 +134,7 @@ class EventItemPopover extends Component {
<Col span={2}>
<div />
</Col>
<Col span={22}>
<span className="header1-text">{start.format('HH:mm')}</span><span className="help-text" style={{marginLeft: '8px'}}>{start.format(dateFormat)}</span><span className="header2-text" style={{marginLeft: '8px'}}>-</span><span className="header1-text" style={{marginLeft: '8px'}}>{end.format('HH:mm')}</span><span className="help-text" style={{marginLeft: '8px'}}>{end.format(dateFormat)}</span>
</Col>
{dateTimeRow}
</Row>
{opsRow}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {
checkConflict: false,
scrollToSpecialMomentEnabled: true,
eventItemPopoverEnabled: true,
eventItemPopoverShowColor: true,
calendarPopoverEnabled: true,
recurringEventsEnabled: true,
headerEnabled: true,
Expand Down