Skip to content

Commit

Permalink
Create slots on Timeline click
Browse files Browse the repository at this point in the history
  • Loading branch information
renefs committed Oct 31, 2024
1 parent 1633f31 commit b5119af
Show file tree
Hide file tree
Showing 5 changed files with 323 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import PropTypes from 'prop-types';
/**
* Displays a placeholder for a candidate time slot when the Timeline is hovered.
*/
export default function CandidatePlaceholder({xPosition, yPosition, height, widthPercent}) {
return (
<div
style={{
background: 'rgba(0, 0, 0, 0.3)',
borderRadius: '3px',
color: 'white',
display: 'block',
height: height,
left: xPosition,
padding: '4px',
position: 'fixed',
pointerEvents: 'none',
top: yPosition,
transform: 'translate(-50%, -100%)',
width: `${widthPercent}%`,
zIndex: 1000,
}}
/>
);
}

CandidatePlaceholder.propTypes = {
height: PropTypes.number.isRequired,
widthPercent: PropTypes.number.isRequired,
xPosition: PropTypes.number.isRequired,
yPosition: PropTypes.number.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function SlotEditWidget({startTime, onChange, isValidTime, slot}) {
<Popup
className={styles['timepicker-popup']}
on="click"
onClick={e => e.stopPropagation()}
content={
<>
<TimePicker
Expand Down Expand Up @@ -68,6 +69,7 @@ export default function CandidateSlot({
}) {
const slot = (
<Slot
onClick={e => e.stopPropagation()}
width={width}
pos={pos}
moreStyles={styles['candidate']}
Expand Down
Loading

0 comments on commit b5119af

Please # to comment.