@@ -3,11 +3,8 @@ import { computed, inject, ref } from 'vue';
33import { storeToRefs } from ' pinia' ;
44import { useI18n } from ' vue-i18n' ;
55import {
6- PhGlobe ,
7- PhCalendarDot ,
86 PhCalendarBlank ,
97 PhClock ,
10- PhCheckCircle ,
118 PhMapPin
129} from ' @phosphor-icons/vue' ;
1310import { PrimaryButton } from ' @thunderbirdops/services-ui' ;
@@ -40,6 +37,7 @@ const bookingRequestError = ref<string>('');
4037
4138const timezone = computed (() => dj .tz .guess ());
4239const selectedSlotDate = computed (() => dj (selectedEvent .value ?.start ).format (' LL' ))
40+ const selectedSlotDateDayOfWeek = computed (() => dj (selectedEvent .value ?.start ).format (' dddd' ));
4341const 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
168186aside {
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+ h 3 {
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.25 rem ;
177- background-color : var (--colour-neutral-raised );
178- margin-block-end : 1 rem ;
206+ padding : 1rem 1 .5rem ;
207+ border : 1px solid var (--colour-neutral-border );
208+ border-radius : 4 px ;
209+ background-color : var (--colour-neutral-lower );
210+ margin-block-end : 1.5 rem ;
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 : 470 px ;
306+ width : 268 px ;
242307 }
243308}
244309 </style >
0 commit comments