Skip to content

Commit

Permalink
Add left margin to timeline and fix colors in edit mode
Browse files Browse the repository at this point in the history
Display placeholder only in the green timeline

Display participants if not in edit mode
  • Loading branch information
renefs committed Dec 13, 2024
1 parent d3357d2 commit f94b306
Showing 3 changed files with 25 additions and 17 deletions.
17 changes: 9 additions & 8 deletions newdle/client/src/components/creation/timeslots/Timeline.js
Original file line number Diff line number Diff line change
@@ -270,6 +270,7 @@ function TimelineInput({minHour, maxHour}) {
<div>
<div
ref={timelineRef}
style={{position: 'relative'}}
className={`${styles['timeline-input']} ${styles['edit']}`}
onClick={event => {
handleMouseDown(event);
@@ -436,12 +437,6 @@ function TimelineContent({busySlots: allBusySlots, minHour, maxHour}) {
setEditing(true);
};

if (!editing && candidates.length === 0) {
return (
<ClickToAddTimeSlots startEditing={() => setEditing(true)} copyTimeSlots={copyTimeSlots} />
);
}

return (
<>
<div className={styles['timeline-rows']}>
@@ -454,7 +449,13 @@ function TimelineContent({busySlots: allBusySlots, minHour, maxHour}) {
return <BusyColumn {...slot} key={key} />;
})
)}
<TimelineInput minHour={minHour} maxHour={maxHour} />
{editing && <TimelineInput minHour={minHour} maxHour={maxHour} />}
{!editing && candidates.length === 0 && (
<ClickToAddTimeSlots
startEditing={() => setEditing(true)}
copyTimeSlots={copyTimeSlots}
/>
)}
</div>
{editing && candidates.length === 0 && (
<div className={styles['add-first-text']}>
@@ -556,7 +557,7 @@ export default function Timeline({date, availability, defaultMinHour, defaultMax
</Grid>
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Row className={styles['timeline-content']}>
<Grid.Column>
<div className={styles['timeline-slot-picker']}>
<TimelineHeader hourSeries={hourSeries} hourSpan={hourSpan} hourStep={hourStep} />
Original file line number Diff line number Diff line change
@@ -17,6 +17,12 @@ $rows-border-width: 5px;
}
}

.timeline-content {
@media screen and (min-width: 1200px) {
margin-left: $label-width;
}
}

.timeline-date {
color: $coral;
}
@@ -46,8 +52,6 @@ $rows-border-width: 5px;
}
.timeline-rows {
position: relative;
background-color: lighten($green, 27%);
border: $rows-border-width solid lighten($green, 22%);

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

background-color: lighten($green, 27%);
border: $rows-border-width solid lighten($green, 22%);

.add-btn-wrapper {
display: flex;
align-items: center;
14 changes: 7 additions & 7 deletions newdle/client/src/locales/es/messages.po
Original file line number Diff line number Diff line change
@@ -111,11 +111,11 @@ msgstr ""
msgid "Choose your participants"
msgstr "Elige a los participantes"

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

#: src/components/creation/timeslots/Timeline.js:408
#: src/components/creation/timeslots/Timeline.js:409
msgid "Click to add time slots"
msgstr ""

@@ -145,7 +145,7 @@ msgstr ""
msgid "Copied!"
msgstr ""

#: src/components/creation/timeslots/Timeline.js:413
#: src/components/creation/timeslots/Timeline.js:414
msgid "Copy time slots from previous day"
msgstr ""

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

#: src/components/creation/timeslots/Timeline.js:520
#: src/components/creation/timeslots/Timeline.js:521
msgid "Revert to the local timezone"
msgstr ""

@@ -523,11 +523,11 @@ msgstr ""
msgid "Timeslots"
msgstr ""

#: src/components/creation/timeslots/Timeline.js:528
#: src/components/creation/timeslots/Timeline.js:529
msgid "Timezone"
msgstr ""

#: src/components/creation/timeslots/Timeline.js:526
#: src/components/creation/timeslots/Timeline.js:527
msgid "Timezone {revertIcon}"
msgstr ""

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

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

0 comments on commit f94b306

Please sign in to comment.