Skip to content

Commit 9a3e1d6

Browse files
committed
Update aside styles in slot selection
1 parent e3dc6f1 commit 9a3e1d6

File tree

6 files changed

+181
-207
lines changed

6 files changed

+181
-207
lines changed

frontend/src/locales/de.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@
262262
"connectedAs": "Verbunden als {name}",
263263
"contact": "Kontakt",
264264
"continue": "Weiter",
265-
"continueAsGuest": "Weiter als Gast",
266265
"contributeToThisSite": "Dieser Seite beitragen",
267266
"cookies": "Cookies",
268267
"copied": "Kopiert",
@@ -360,6 +359,7 @@
360359
"next": "Weiter",
361360
"nextWeek": "Nächste Woche",
362361
"no": "Nein",
362+
"noneSelected": "Keine Auswahl",
363363
"earlier": "Früher",
364364
"notConnected": "Nicht verbunden",
365365
"notProvided": "Keine Angabe",
@@ -408,7 +408,7 @@
408408
"searchAppointments": "Termine durchsuchen",
409409
"searchForCalendars": "Nach Kalendern suchen",
410410
"secondaryTimeZone": "Sekundäre Zeitzone",
411-
"selectATimeFromTheCalendar": "Zeit aus dem Kalender wählen",
411+
"selectATimeFromTheCalendar": "Wähle einen freien Zeitpunkt aus dem Kalender",
412412
"selectCalendar": "Kalender auswählen",
413413
"selectDays": "Wochentage auswählen",
414414
"selectDateForWeek": "Datum für Woche auswählen",
@@ -481,7 +481,8 @@
481481
"yes": "Ja",
482482
"youAreBookable": "Du bist verfügbar",
483483
"youAreNotBookable": "Du bist nicht verfügbar",
484-
"youHaveUnsavedChanges": "Du hast ungespeicherte Änderungen"
484+
"youHaveUnsavedChanges": "Du hast ungespeicherte Änderungen",
485+
"yourAppointmentWillBeConfirmedAutomatically": "Deine Buchung wird automatisch bestätigt."
485486
},
486487
"locales": {
487488
"de": "Deutsch",

frontend/src/locales/en.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@
265265
"connectedAs": "Connected as {name}",
266266
"contact": "Contact",
267267
"continue": "Continue",
268-
"continueAsGuest": "Continue as Guest",
269268
"contributeToThisSite": "Contribute to this site",
270269
"cookies": "Cookies",
271270
"copied": "Copied",
@@ -364,6 +363,7 @@
364363
"next": "Next",
365364
"nextWeek": "Next week",
366365
"no": "No",
366+
"noneSelected": "None selected",
367367
"notConnected": "Not connected",
368368
"notProvided": "Not Provided",
369369
"notVerified": "Not Verified",
@@ -411,7 +411,7 @@
411411
"searchAppointments": "Search bookings",
412412
"searchForCalendars": "Search for calendars",
413413
"secondaryTimeZone": "Secondary time zone",
414-
"selectATimeFromTheCalendar": "Select a time from the calendar",
414+
"selectATimeFromTheCalendar": "Select an open time slot from the calendar.",
415415
"selectCalendar": "Select calendar",
416416
"selectDays": "Select days",
417417
"selectDateForWeek": "Select date for week",
@@ -484,7 +484,8 @@
484484
"yes": "Yes",
485485
"youAreBookable": "You're bookable",
486486
"youAreNotBookable": "You're not bookable",
487-
"youHaveUnsavedChanges": "You have unsaved changes"
487+
"youHaveUnsavedChanges": "You have unsaved changes",
488+
"yourAppointmentWillBeConfirmedAutomatically": "Your appointment will be confirmed automatically."
488489
},
489490
"locales": {
490491
"de": "German",

frontend/src/views/BookerView/components/BookingViewSlotSelection.vue

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ async function onDateChange(dateObj: TimeFormatted) {
6262
<template v-if="appointment">
6363
<slot-selection-header />
6464

65+
<div class="week-picker-container">
66+
<week-picker
67+
:active-date-range="activeDateRange"
68+
:onDateChange="onDateChange"
69+
/>
70+
</div>
71+
6572
<div class="booker-view-container">
6673
<div class="calendar-container">
67-
<div class="week-picker-container">
68-
<week-picker
69-
:active-date-range="activeDateRange"
70-
:onDateChange="onDateChange"
71-
/>
72-
</div>
7374
<week-calendar
7475
:active-date-range="activeDateRange"
7576
:selectable-slots="appointment.slots"
@@ -96,12 +97,12 @@ async function onDateChange(dateObj: TimeFormatted) {
9697
gap: 2rem;
9798
}
9899
99-
.calendar-container {
100-
width: 100%;
100+
.week-picker-container {
101+
margin-block-end: 2rem;
102+
}
101103
102-
.week-picker-container {
103-
margin-block-end: 2rem;
104-
}
104+
.calendar-container {
105+
flex: 1;
105106
106107
.calendar-footer {
107108
display: flex;

frontend/src/views/BookerView/components/SlotSelectionAside.vue

Lines changed: 139 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import { computed, inject, ref } from 'vue';
33
import { storeToRefs } from 'pinia';
44
import { useI18n } from 'vue-i18n';
55
import {
6-
PhGlobe,
7-
PhCalendarDot,
86
PhCalendarBlank,
97
PhClock,
10-
PhCheckCircle,
118
PhMapPin
129
} from '@phosphor-icons/vue';
1310
import { PrimaryButton } from '@thunderbirdops/services-ui';
@@ -40,6 +37,7 @@ const bookingRequestError = ref<string>('');
4037
4138
const timezone = computed(() => dj.tz.guess());
4239
const selectedSlotDate = computed(() => dj(selectedEvent.value?.start).format('LL'))
40+
const selectedSlotDateDayOfWeek = computed(() => dj(selectedEvent.value?.start).format('dddd'));
4341
const selectedSlotTimeDuration = computed(() => {
4442
const startTime = dj(selectedEvent.value?.start).format('LT');
4543
const endTime = dj(selectedEvent.value?.start)
@@ -111,112 +109,170 @@ const bookEvent = async () => {
111109

112110
<template>
113111
<aside>
112+
<h3>{{ t('label.bookingDetails') }}</h3>
113+
114114
<template v-if="selectedEvent">
115-
<div class="appointment-card">
116-
<h3>{{ t('label.bookingDetails') }}</h3>
117-
<div class="appointment-card-inner">
118-
<header>
119-
{{ selectedEvent.title }}
120-
<ph-check-circle size="24"/>
121-
</header>
122-
<div class="appointment-card-inner-details">
123-
<ph-calendar-blank size="16"/>
124-
<span>{{ selectedSlotDate }}</span>
125-
<ph-map-pin size="16"/>
115+
<div class="appointment-card-inner">
116+
<header>{{ selectedEvent.title }}</header>
117+
<div class="appointment-card-inner-details">
118+
<div class="appointment-card-inner-details-item">
119+
<ph-calendar-blank size="20"/>
120+
<div class="appointment-card-inner-details-item-details">
121+
<p>{{ selectedSlotDateDayOfWeek }}</p>
122+
<span>{{ selectedSlotDate }}</span>
123+
</div>
124+
</div>
125+
<div class="appointment-card-inner-details-item">
126+
<ph-clock size="20"/>
127+
<div class="appointment-card-inner-details-item-details">
128+
<p>{{ timezone }}</p>
129+
<span>{{ selectedSlotTimeDuration }}</span>
130+
</div>
131+
</div>
132+
<div class="appointment-card-inner-details-item">
133+
<ph-clock size="20"/>
134+
<span>{{ t('units.minutes', { value: selectedEvent.slot_duration }) }}</span>
135+
</div>
136+
<div class="appointment-card-inner-details-item">
137+
<ph-map-pin size="20"/>
126138
<!-- TODO: We are currently only allowing for events to be online but the backend defaults to in person -->
127139
<!-- <span>{{ selectedEvent.location_type === EventLocationType.Online ? t('label.virtual') : t('label.inPerson') }}</span> -->
128140
<span>{{ t('label.virtual') }}</span>
129-
<ph-clock size="16"/>
130-
<span>{{ selectedSlotTimeDuration }} <span class="timezone-badge">{{ timezone }}</span></span>
131-
<ph-clock size="16"/>
132-
<span>{{ t('units.minutes', { value: selectedEvent.slot_duration }) }}</span>
133141
</div>
134142
</div>
135143
</div>
136144

137-
<slot-selection-user-info v-if="!userStore.authenticated" />
145+
<slot-selection-user-info />
146+
147+
<alert-box
148+
v-if="bookingRequestError"
149+
:alert="{ title: bookingRequestError }"
150+
:scheme="AlertSchemes.Error"
151+
@close="bookingRequestError = ''"
152+
class="booking-request-error"
153+
/>
154+
155+
<primary-button
156+
v-if="selectedEvent"
157+
:label="t('label.confirmSelection')"
158+
:disabled="bookingRequestLoading || !guestUserInfoValid"
159+
@click="bookEvent"
160+
:title="t('label.confirm')"
161+
class="confirm-selection-button"
162+
data-testid="booking-view-confirm-selection-button"
163+
>
164+
{{ t('label.confirmSelection') }}
165+
</primary-button>
166+
167+
<p
168+
v-if="selectedEvent && !appointment.booking_confirmation"
169+
class="confirmation-footer-note"
170+
>
171+
{{ t('label.yourAppointmentWillBeConfirmedAutomatically') }}
172+
</p>
138173
</template>
139174

140175
<div v-else class="appointment-card empty">
141-
{{ t('label.selectATimeFromTheCalendar') }}
142-
<ph-calendar-dot size="108"/>
176+
<ph-calendar-blank size="24" class="empty-icon" weight="duotone" />
177+
<strong>{{ t('label.noneSelected') }}</strong>
178+
<p>{{ t('label.selectATimeFromTheCalendar') }}</p>
143179
</div>
144-
145-
<alert-box
146-
v-if="bookingRequestError"
147-
:alert="{ title: bookingRequestError }"
148-
:scheme="AlertSchemes.Error"
149-
@close="bookingRequestError = ''"
150-
/>
151-
152-
<primary-button
153-
:label="t('label.confirmSelection')"
154-
:disabled="!selectedEvent || bookingRequestLoading || (!userStore.authenticated && !guestUserInfoValid)"
155-
@click="bookEvent"
156-
:title="t('label.confirm')"
157-
class="confirm-selection-button"
158-
data-testid="booking-view-confirm-selection-button"
159-
>
160-
{{ t('label.confirmSelection') }}
161-
</primary-button>
162180
</aside>
163181
</template>
164182

165183
<style scoped>
166184
@import '@/assets/styles/custom-media.pcss';
167185
168186
aside {
187+
display: flex;
188+
flex-direction: column;
189+
padding: 1.5rem 1rem;
190+
border: 1px solid var(--colour-neutral-border);
191+
border-radius: 24px;
192+
background-color: var(--colour-neutral-base);
193+
font-family: Inter, sans-serif;
194+
195+
h3 {
196+
font-weight: 600;
197+
color: var(--colour-ti-highlight);
198+
margin-block-end: 1.5rem;
199+
}
200+
169201
.appointment-card {
170202
display: flex;
171203
flex-direction: column;
172204
justify-content: center;
173205
gap: 1rem;
174-
padding: 1rem 0.5rem;
175-
border: 1px dashed var(--colour-neutral-border);
176-
border-radius: 0.25rem;
177-
background-color: var(--colour-neutral-raised);
178-
margin-block-end: 1rem;
206+
padding: 1rem 1.5rem;
207+
border: 1px solid var(--colour-neutral-border);
208+
border-radius: 4px;
209+
background-color: var(--colour-neutral-lower);
210+
margin-block-end: 1.5rem;
179211
180212
&.empty {
181213
align-items: center;
182-
padding: 4rem 1.5rem;
214+
text-align: center;
215+
font-size: 1rem;
216+
gap: 0;
217+
margin-block-end: 0;
218+
219+
.empty-icon {
220+
margin-block: 0.75rem 1.5rem;
221+
}
222+
223+
strong {
224+
font-weight: 500;
225+
margin-block-end: 0.5rem;
226+
}
227+
228+
p {
229+
font-size: 0.875rem;
230+
margin-block-end: 0.75rem;
231+
}
183232
}
233+
}
184234
185-
h3 {
186-
text-align: center;
187-
font-weight: 500;
235+
.appointment-card-inner {
236+
padding: 0.75rem;
237+
border-radius: 0.25rem;
238+
color: black; /* TODO: Update colors when hi-fi is available */
239+
background-color: var(--colour-primary-soft);
240+
margin-block-end: 1.5rem;
241+
242+
header {
243+
display: flex;
244+
align-items: center;
245+
justify-content: space-between;
246+
font-weight: 600;
247+
margin-block-end: 0.5rem;
188248
}
189249
190-
.appointment-card-inner {
191-
padding: 1rem 1.5rem;
192-
border-radius: 0.25rem;
193-
color: black; /* TODO: Update colors when hi-fi is available */
194-
background-color: #58C9FF; /* TODO: Update colors when hi-fi is available */
250+
.appointment-card-inner-details {
251+
display: flex;
252+
flex-direction: column;
253+
gap: 0.5rem;
254+
font-size: 0.875rem;
255+
color: var(--colour-ti-base);
195256
196-
header {
257+
.appointment-card-inner-details-item {
197258
display: flex;
198259
align-items: center;
199-
justify-content: space-between;
200-
margin-block-end: 1rem;
201-
}
260+
gap: 0.5rem;
202261
203-
.appointment-card-inner-details {
204-
display: grid;
205-
grid-template-columns: 1.5rem 1fr;
206-
align-items: center;
207-
row-gap: 0.25rem;
208-
column-gap: 0.125rem;
209-
210-
.timezone-badge {
211-
color: #58C9FF; /* TODO: Update colors when hi-fi is available */
212-
background-color: black; /* TODO: Update colors when hi-fi is available */
213-
font-size: 0.75rem;
214-
padding: 0.25rem 0.375rem;
215-
margin-inline-start: 0.25rem;
216-
border-radius: 8px;
217-
white-space: nowrap;
262+
.appointment-card-inner-details-item-details {
263+
display: flex;
264+
flex-direction: column;
265+
266+
p {
267+
line-height: 0.75rem;
268+
font-size: 0.6875rem;
269+
}
218270
}
219271
}
272+
273+
svg {
274+
color: var(--colour-ti-highlight);
275+
}
220276
}
221277
}
222278
@@ -228,8 +284,17 @@ aside {
228284
color: var(--colour-danger-default);
229285
}
230286
287+
.booking-request-error {
288+
margin-block: 1rem 0;
289+
}
290+
231291
.confirm-selection-button {
232-
margin-inline-start: auto;
292+
margin-block-start: 1rem;
293+
}
294+
295+
.confirmation-footer-note {
296+
text-align: center;
297+
font-size: 0.6875rem;
233298
margin-block-start: 1rem;
234299
}
235300
}
@@ -238,7 +303,7 @@ aside {
238303
aside {
239304
position: sticky;
240305
top: 5rem;
241-
width: 470px;
306+
width: 268px;
242307
}
243308
}
244309
</style>

0 commit comments

Comments
 (0)