Skip to content

Commit f94b306

Browse files
committed
Add left margin to timeline and fix colors in edit mode
Display placeholder only in the green timeline Display participants if not in edit mode
1 parent d3357d2 commit f94b306

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

newdle/client/src/components/creation/timeslots/Timeline.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ function TimelineInput({minHour, maxHour}) {
270270
<div>
271271
<div
272272
ref={timelineRef}
273+
style={{position: 'relative'}}
273274
className={`${styles['timeline-input']} ${styles['edit']}`}
274275
onClick={event => {
275276
handleMouseDown(event);
@@ -436,12 +437,6 @@ function TimelineContent({busySlots: allBusySlots, minHour, maxHour}) {
436437
setEditing(true);
437438
};
438439

439-
if (!editing && candidates.length === 0) {
440-
return (
441-
<ClickToAddTimeSlots startEditing={() => setEditing(true)} copyTimeSlots={copyTimeSlots} />
442-
);
443-
}
444-
445440
return (
446441
<>
447442
<div className={styles['timeline-rows']}>
@@ -454,7 +449,13 @@ function TimelineContent({busySlots: allBusySlots, minHour, maxHour}) {
454449
return <BusyColumn {...slot} key={key} />;
455450
})
456451
)}
457-
<TimelineInput minHour={minHour} maxHour={maxHour} />
452+
{editing && <TimelineInput minHour={minHour} maxHour={maxHour} />}
453+
{!editing && candidates.length === 0 && (
454+
<ClickToAddTimeSlots
455+
startEditing={() => setEditing(true)}
456+
copyTimeSlots={copyTimeSlots}
457+
/>
458+
)}
458459
</div>
459460
{editing && candidates.length === 0 && (
460461
<div className={styles['add-first-text']}>
@@ -556,7 +557,7 @@ export default function Timeline({date, availability, defaultMinHour, defaultMax
556557
</Grid>
557558
</Grid.Column>
558559
</Grid.Row>
559-
<Grid.Row>
560+
<Grid.Row className={styles['timeline-content']}>
560561
<Grid.Column>
561562
<div className={styles['timeline-slot-picker']}>
562563
<TimelineHeader hourSeries={hourSeries} hourSpan={hourSpan} hourStep={hourStep} />

newdle/client/src/components/creation/timeslots/Timeline.module.scss

+9-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ $rows-border-width: 5px;
1717
}
1818
}
1919

20+
.timeline-content {
21+
@media screen and (min-width: 1200px) {
22+
margin-left: $label-width;
23+
}
24+
}
25+
2026
.timeline-date {
2127
color: $coral;
2228
}
@@ -46,8 +52,6 @@ $rows-border-width: 5px;
4652
}
4753
.timeline-rows {
4854
position: relative;
49-
background-color: lighten($green, 27%);
50-
border: $rows-border-width solid lighten($green, 22%);
5155

5256
.timeline-row {
5357
height: $row-height;
@@ -219,6 +223,9 @@ $rows-border-width: 5px;
219223
padding-top: 10px;
220224
padding-bottom: 10px;
221225

226+
background-color: lighten($green, 27%);
227+
border: $rows-border-width solid lighten($green, 22%);
228+
222229
.add-btn-wrapper {
223230
display: flex;
224231
align-items: center;

newdle/client/src/locales/es/messages.po

+7-7
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ msgstr ""
111111
msgid "Choose your participants"
112112
msgstr "Elige a los participantes"
113113

114-
#: src/components/creation/timeslots/Timeline.js:462
114+
#: src/components/creation/timeslots/Timeline.js:463
115115
msgid "Click the timeline to add your first time slot"
116116
msgstr ""
117117

118-
#: src/components/creation/timeslots/Timeline.js:408
118+
#: src/components/creation/timeslots/Timeline.js:409
119119
msgid "Click to add time slots"
120120
msgstr ""
121121

@@ -145,7 +145,7 @@ msgstr ""
145145
msgid "Copied!"
146146
msgstr ""
147147

148-
#: src/components/creation/timeslots/Timeline.js:413
148+
#: src/components/creation/timeslots/Timeline.js:414
149149
msgid "Copy time slots from previous day"
150150
msgstr ""
151151

@@ -406,7 +406,7 @@ msgstr ""
406406
msgid "Please log in again to confirm your identity"
407407
msgstr ""
408408

409-
#: src/components/creation/timeslots/Timeline.js:520
409+
#: src/components/creation/timeslots/Timeline.js:521
410410
msgid "Revert to the local timezone"
411411
msgstr ""
412412

@@ -523,11 +523,11 @@ msgstr ""
523523
msgid "Timeslots"
524524
msgstr ""
525525

526-
#: src/components/creation/timeslots/Timeline.js:528
526+
#: src/components/creation/timeslots/Timeline.js:529
527527
msgid "Timezone"
528528
msgstr ""
529529

530-
#: src/components/creation/timeslots/Timeline.js:526
530+
#: src/components/creation/timeslots/Timeline.js:527
531531
msgid "Timezone {revertIcon}"
532532
msgstr ""
533533

@@ -637,7 +637,7 @@ msgstr ""
637637
msgid "switch back to the <0>{defaultUserTz}</0> timezone"
638638
msgstr ""
639639

640-
#: src/components/creation/timeslots/Timeline.js:316
640+
#: src/components/creation/timeslots/Timeline.js:317
641641
msgid "{0, plural, =0 {No participants registered} one {# participant registered} other {# participants registered}}"
642642
msgstr ""
643643

0 commit comments

Comments
 (0)