Merge pull request #276 from GRA0007/feat/sticky-hours
Stick hours to the left of the screen when scrolling
This commit is contained in:
commit
7b41c6e2df
|
|
@ -89,6 +89,7 @@ const AvailabilityEditor = ({ times, timezone, value = [], onChange, table }: Av
|
||||||
key={y}
|
key={y}
|
||||||
className={makeClass(styles.time, selecting.length === 0 && styles.editable)}
|
className={makeClass(styles.time, selecting.length === 0 && styles.editable)}
|
||||||
style={{
|
style={{
|
||||||
|
touchAction: 'none',
|
||||||
backgroundColor: isSelected ? palette[1].string : palette[0].string,
|
backgroundColor: isSelected ? palette[1].string : palette[0].string,
|
||||||
'--hover-color': isSelected ? palette[0].highlight : palette[1].highlight,
|
'--hover-color': isSelected ? palette[0].highlight : palette[1].highlight,
|
||||||
...cell.minute !== 0 && cell.minute !== 30 && { borderTopColor: 'transparent' },
|
...cell.minute !== 0 && cell.minute !== 30 && { borderTopColor: 'transparent' },
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,20 @@
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 40px;
|
|
||||||
padding-right: 6px;
|
padding-right: 6px;
|
||||||
|
position: sticky;
|
||||||
|
left: 6px;
|
||||||
|
z-index: 5;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-top: 1em;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeSpace {
|
.timeSpace {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-top: 2px solid transparent;
|
border-top: 2px solid transparent;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
&.grey {
|
&.grey {
|
||||||
background-origin: border-box;
|
background-origin: border-box;
|
||||||
|
|
@ -37,13 +43,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeLabel {
|
.timeLabel {
|
||||||
display: block;
|
display: inline-block;
|
||||||
position: absolute;
|
transform: translateY(calc(-50% - 2px));
|
||||||
top: -.7em;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-align: right;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
width: 100%;
|
background: var(--background);
|
||||||
|
border-radius: .3em;
|
||||||
|
padding: .1em .2em;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dateColumn {
|
.dateColumn {
|
||||||
|
|
@ -97,7 +104,6 @@
|
||||||
height: 10px;
|
height: 10px;
|
||||||
background-origin: border-box;
|
background-origin: border-box;
|
||||||
transition: background-color .1s;
|
transition: background-color .1s;
|
||||||
touch-action: none;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
border-top-width: 2px;
|
border-top-width: 2px;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue