favesalon-embed 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
- package/dist/cjs/chat-button.cjs.entry.js +118 -0
- package/dist/cjs/colors-38421769.js +69 -0
- package/dist/cjs/favesalon-embed.cjs.js +24 -0
- package/dist/cjs/google-map_5.cjs.entry.js +310 -0
- package/{cjs/index-7d179a70.js → dist/cjs/index-47c2a5f6.js} +587 -199
- package/dist/cjs/index-7f190886.js +4396 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/relativeTime-3721080d.js +9 -0
- package/dist/cjs/salon-booking-modal.cjs.entry.js +30 -0
- package/dist/cjs/salon-booking.cjs.entry.js +51 -0
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
- package/dist/cjs/salon-gift-card.cjs.entry.js +51 -0
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
- package/dist/cjs/salon-lookbook.cjs.entry.js +222 -0
- package/dist/cjs/salon-ranking.cjs.entry.js +60 -0
- package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
- package/dist/cjs/salon-services.cjs.entry.js +81 -0
- package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
- package/dist/cjs/services-125c82d8.js +21492 -0
- package/dist/cjs/style-detail.cjs.entry.js +312 -0
- package/dist/cjs/user-avatar.cjs.entry.js +45 -0
- package/dist/cjs/utils-c5a33b3c.js +23 -0
- package/{collection → dist/collection}/collection-manifest.json +5 -4
- package/dist/collection/components/chat-button/index.css +122 -0
- package/dist/collection/components/chat-button/index.js +218 -0
- package/dist/collection/components/chat-conversation/index.js +103 -0
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/{collection → dist/collection}/components/google-map/index.css +0 -1
- package/dist/collection/components/google-map/index.js +90 -0
- package/{collection → dist/collection}/components/salon-booking/index.css +11 -20
- package/dist/collection/components/salon-booking/index.js +126 -0
- package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
- package/dist/collection/components/salon-gift-card/index.css +30 -0
- package/dist/collection/components/salon-gift-card/index.js +126 -0
- package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
- package/dist/collection/components/salon-info/index.js +77 -0
- package/dist/collection/components/salon-latest-reviews/index.js +163 -0
- package/dist/collection/components/salon-latest-styles/index.css +12 -0
- package/dist/collection/components/salon-latest-styles/index.js +183 -0
- package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +7 -4
- package/dist/collection/components/salon-locations/index.js +143 -0
- package/dist/collection/components/salon-lookbook/index.css +15 -0
- package/dist/collection/components/salon-lookbook/index.js +368 -0
- package/dist/collection/components/salon-ranking/index.js +117 -0
- package/dist/collection/components/salon-reviews/index.css +18 -0
- package/dist/collection/components/salon-reviews/index.js +249 -0
- package/dist/collection/components/salon-schedules/index.css +18 -0
- package/dist/collection/components/salon-schedules/index.js +167 -0
- package/dist/collection/components/salon-services/index.css +1 -0
- package/dist/collection/components/salon-services/index.js +146 -0
- package/dist/collection/components/salon-stylists/index.js +184 -0
- package/dist/collection/components/style-detail/index.css +76 -0
- package/dist/collection/components/style-detail/index.js +386 -0
- package/dist/collection/components/user-avatar/index.js +134 -0
- package/dist/collection/constants/colors.js +65 -0
- package/dist/collection/mocks/users.js +10 -0
- package/dist/collection/services/services.js +295 -0
- package/dist/collection/types/chat.js +23 -0
- package/dist/collection/types/common.js +11 -0
- package/{collection → dist/collection}/types/review.js +9 -5
- package/dist/collection/types/salon.js +58 -0
- package/dist/collection/types/style.js +128 -0
- package/dist/collection/types/stylist.js +30 -0
- package/dist/collection/types/user.js +10 -0
- package/{custom-elements → dist/custom-elements}/index.d.ts +18 -12
- package/dist/custom-elements/index.js +28340 -0
- package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
- package/dist/esm/chat-button.entry.js +114 -0
- package/dist/esm/colors-ea36347a.js +67 -0
- package/dist/esm/favesalon-embed.js +19 -0
- package/dist/esm/google-map_5.entry.js +302 -0
- package/{esm/index-2160b80b.js → dist/esm/index-3fae868e.js} +586 -200
- package/dist/esm/index-80523fec.js +4393 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/relativeTime-cd452e6d.js +7 -0
- package/dist/esm/salon-booking-modal.entry.js +26 -0
- package/dist/esm/salon-booking.entry.js +47 -0
- package/dist/esm/salon-gift-card-modal.entry.js +25 -0
- package/dist/esm/salon-gift-card.entry.js +47 -0
- package/dist/esm/salon-latest-reviews.entry.js +93 -0
- package/dist/esm/salon-lookbook.entry.js +218 -0
- package/dist/esm/salon-ranking.entry.js +56 -0
- package/dist/esm/salon-reviews.entry.js +189 -0
- package/dist/esm/salon-services.entry.js +77 -0
- package/dist/esm/salon-stylists.entry.js +114 -0
- package/dist/esm/services-40a3e622.js +21485 -0
- package/dist/esm/style-detail.entry.js +308 -0
- package/dist/esm/user-avatar.entry.js +41 -0
- package/dist/esm/utils-e97485e0.js +19 -0
- package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
- package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
- package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
- package/dist/favesalon-embed/p-019c5ccd.entry.js +1 -0
- package/dist/favesalon-embed/p-083a8821.entry.js +1 -0
- package/dist/favesalon-embed/p-0d0ed9ea.entry.js +1 -0
- package/dist/favesalon-embed/p-119db8de.entry.js +1 -0
- package/dist/favesalon-embed/p-1432c51b.entry.js +1 -0
- package/dist/favesalon-embed/p-22093506.entry.js +1 -0
- package/dist/favesalon-embed/p-32b314e9.js +2 -0
- package/dist/favesalon-embed/p-47e646f8.js +1 -0
- package/dist/favesalon-embed/p-4a5eca9a.js +6 -0
- package/dist/favesalon-embed/p-58d2e9be.js +1 -0
- package/dist/favesalon-embed/p-71404b6a.entry.js +1 -0
- package/dist/favesalon-embed/p-857c3a61.entry.js +1 -0
- package/dist/favesalon-embed/p-99ec77f7.entry.js +1 -0
- package/dist/favesalon-embed/p-a33331cc.js +1 -0
- package/dist/favesalon-embed/p-b0c3673a.entry.js +1 -0
- package/dist/favesalon-embed/p-b287b1ea.entry.js +1 -0
- package/dist/favesalon-embed/p-b3af7842.entry.js +1 -0
- package/dist/favesalon-embed/p-b630ae68.js +1580 -0
- package/dist/favesalon-embed/p-ce2c1c9a.entry.js +1 -0
- package/dist/favesalon-embed/p-d6083940.js +1 -0
- package/dist/favesalon-embed/p-d9b7ad58.entry.js +1 -0
- package/dist/favesalon-embed/p-fc9a5551.js +6 -0
- package/dist/types/components/chat-button/index.d.ts +24 -0
- package/dist/types/components/google-map/index.d.ts +5 -0
- package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
- package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
- package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
- package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
- package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
- package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
- package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
- package/dist/types/components/salon-reviews/index.d.ts +24 -0
- package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
- package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
- package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
- package/dist/types/components/style-detail/index.d.ts +24 -0
- package/{types → dist/types}/components.d.ts +82 -41
- package/dist/types/constants/colors.d.ts +65 -0
- package/dist/types/mocks/users.d.ts +10 -0
- package/dist/types/services/services.d.ts +75 -0
- package/{types → dist/types}/stencil-public-runtime.d.ts +85 -11
- package/dist/types/types/chat.d.ts +17 -0
- package/dist/types/types/common.d.ts +11 -0
- package/{types → dist/types}/types/review.d.ts +4 -0
- package/{types → dist/types}/types/salon.d.ts +3 -1
- package/dist/types/types/style.d.ts +88 -0
- package/{types → dist/types}/types/stylist.d.ts +2 -1
- package/{types → dist/types}/types/user.d.ts +2 -2
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +19 -14
- package/readme.md +25 -2
- package/cjs/favesalon-embed.cjs.js +0 -20
- package/cjs/google-map_15.cjs.entry.js +0 -6632
- package/cjs/loader.cjs.js +0 -22
- package/cjs/salon-booking-modal.cjs.entry.js +0 -23
- package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
- package/collection/components/google-map/index.js +0 -97
- package/collection/components/salon-booking/index.js +0 -103
- package/collection/components/salon-booking/salon-booking-modal.js +0 -82
- package/collection/components/salon-contact/index.js +0 -88
- package/collection/components/salon-gift-card/index.css +0 -25
- package/collection/components/salon-gift-card/index.js +0 -83
- package/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -43
- package/collection/components/salon-info/index.css +0 -3
- package/collection/components/salon-info/index.js +0 -97
- package/collection/components/salon-latest-reviews/index.js +0 -108
- package/collection/components/salon-locations/index.js +0 -80
- package/collection/components/salon-lookbook/index.css +0 -12
- package/collection/components/salon-lookbook/index.js +0 -303
- package/collection/components/salon-ranking/index.js +0 -114
- package/collection/components/salon-reviews/index.js +0 -291
- package/collection/components/salon-schedules/index.css +0 -14
- package/collection/components/salon-schedules/index.js +0 -103
- package/collection/components/salon-services/index.css +0 -0
- package/collection/components/salon-services/index.js +0 -113
- package/collection/components/salon-styles/index.css +0 -23
- package/collection/components/salon-styles/index.js +0 -100
- package/collection/components/salon-stylists/index.js +0 -96
- package/collection/components/user-avatar/index.css +0 -0
- package/collection/components/user-avatar/index.js +0 -127
- package/collection/constants/colors.js +0 -91
- package/collection/services/services.js +0 -203
- package/collection/types/common.js +0 -2
- package/collection/types/salon.js +0 -52
- package/collection/types/style.js +0 -28
- package/collection/types/stylist.js +0 -13
- package/collection/types/user.js +0 -10
- package/custom-elements/index.js +0 -7410
- package/esm/favesalon-embed.js +0 -18
- package/esm/google-map_15.entry.js +0 -6614
- package/esm/loader.js +0 -18
- package/esm/polyfills/css-shim.js +0 -1
- package/esm/salon-booking-modal.entry.js +0 -19
- package/esm/salon-gift-card-modal.entry.js +0 -16
- package/favesalon-embed/favesalon-embed.esm.js +0 -1
- package/favesalon-embed/p-1432ab16.entry.js +0 -1
- package/favesalon-embed/p-2da2ed75.js +0 -1
- package/favesalon-embed/p-4a5eca9a.js +0 -6
- package/favesalon-embed/p-94a0991e.entry.js +0 -1
- package/favesalon-embed/p-f15bcb43.entry.js +0 -1
- package/types/components/google-map/index.d.ts +0 -10
- package/types/components/salon-contact/index.d.ts +0 -9
- package/types/components/salon-reviews/index.d.ts +0 -23
- package/types/components/salon-styles/index.d.ts +0 -9
- package/types/constants/colors.d.ts +0 -88
- package/types/services/services.d.ts +0 -24
- package/types/types/common.d.ts +0 -2
- package/types/types/style.d.ts +0 -49
- package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
- package/{cjs → dist/cjs}/index.cjs.js +0 -0
- package/{esm/index.js → dist/collection/components/salon-info/index.css} +0 -0
- package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -0
- package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
- package/{collection → dist/collection}/components/salon-stylists/index.css +0 -0
- package/{collection/components/salon-locations → dist/collection/components/user-avatar}/index.css +0 -0
- package/{collection → dist/collection}/global/global.js +0 -0
- package/{collection → dist/collection}/index.js +0 -0
- package/{collection → dist/collection}/types/service.js +0 -0
- package/{collection → dist/collection}/utils/utils.js +0 -0
- package/{esm → dist/esm}/global-e1089ffd.js +0 -0
- package/{esm → dist/esm}/polyfills/core-js.js +0 -0
- package/{esm → dist/esm}/polyfills/dom.js +0 -0
- package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
- package/{esm → dist/esm}/polyfills/index.js +0 -0
- package/{esm → dist/esm}/polyfills/system.js +0 -0
- package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
- package/{index.cjs.js → dist/index.cjs.js} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/{collection/components/salon-reviews/index.css → dist/types/components/chat-conversation/index.d.ts} +0 -0
- package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
- /package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
- /package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
- /package/{types → dist/types}/index.d.ts +0 -0
- /package/{types → dist/types}/types/service.d.ts +0 -0
- /package/{types → dist/types}/utils/utils.d.ts +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { dateTimeFormat } from './common';
|
|
3
|
+
import { createSalon } from './salon';
|
|
4
|
+
import { createService } from './service';
|
|
5
|
+
import { createStylistFromLookbook } from './stylist';
|
|
6
|
+
import { createUser } from './user';
|
|
7
|
+
export var MediaType;
|
|
8
|
+
(function (MediaType) {
|
|
9
|
+
MediaType[MediaType["Photo"] = 0] = "Photo";
|
|
10
|
+
MediaType[MediaType["Video"] = 1] = "Video";
|
|
11
|
+
})(MediaType || (MediaType = {}));
|
|
12
|
+
export class AlbumMedia {
|
|
13
|
+
constructor(fields) {
|
|
14
|
+
Object.assign(this, fields);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function createAlbumMedia(blob) {
|
|
18
|
+
const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
|
|
19
|
+
const createdDateTime = createdDay && createdTime ? dayjs(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
|
|
20
|
+
const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
|
|
21
|
+
const updatedDateTime = updatedDay && updatedTime ? dayjs(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
|
|
22
|
+
const isVideo = blob.media_type === MediaType.Video || blob.full_image_url.indexOf('.mp4') > -1;
|
|
23
|
+
return new AlbumMedia({
|
|
24
|
+
id: blob.id,
|
|
25
|
+
caption: blob.caption,
|
|
26
|
+
description: blob.description,
|
|
27
|
+
createdDate: createdDateTime,
|
|
28
|
+
updatedDate: updatedDateTime,
|
|
29
|
+
mediaUrl: blob.full_image_url,
|
|
30
|
+
imageThumb: !isVideo ? blob.full_image_url_thumb : null,
|
|
31
|
+
imageThumbMedium: !isVideo ? blob.full_image_url_medium : null,
|
|
32
|
+
imageWidth: !isVideo ? blob.img_w : 400,
|
|
33
|
+
imageHeight: !isVideo ? blob.img_h : 300,
|
|
34
|
+
mediaType: isVideo ? MediaType.Video : blob.media_type,
|
|
35
|
+
totalLike: blob.total_like,
|
|
36
|
+
totalDislike: blob.total_dislike,
|
|
37
|
+
totalShare: blob.total_shared,
|
|
38
|
+
totalView: blob.view_count,
|
|
39
|
+
totalBooking: blob.total_booking,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export class Album {
|
|
43
|
+
constructor(fields) {
|
|
44
|
+
Object.assign(this, fields);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function createAlbum(blob) {
|
|
48
|
+
return new Album({
|
|
49
|
+
id: blob.id,
|
|
50
|
+
name: blob.name,
|
|
51
|
+
caption: blob.caption,
|
|
52
|
+
description: blob.description,
|
|
53
|
+
tags: blob.tags ? blob.tags.filter(tag => !!tag) : [],
|
|
54
|
+
salonId: blob.salon_id,
|
|
55
|
+
stylistId: blob.stylist_id,
|
|
56
|
+
totalMedias: blob.total_medias || 0,
|
|
57
|
+
service: blob.service ? createService(blob.service) : null,
|
|
58
|
+
isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export class FaveStyleComment {
|
|
62
|
+
constructor(fields) {
|
|
63
|
+
Object.assign(this, fields);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export function createFaveStyleComment(blob) {
|
|
67
|
+
const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
|
|
68
|
+
const createdDateTime = createdDay && createdTime ? dayjs(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
|
|
69
|
+
const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
|
|
70
|
+
const updatedDateTime = updatedDay && updatedTime ? dayjs(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
|
|
71
|
+
return new FaveStyleComment({
|
|
72
|
+
id: blob.id,
|
|
73
|
+
type: blob.type,
|
|
74
|
+
title: blob.content,
|
|
75
|
+
description: blob.description,
|
|
76
|
+
createdDate: createdDateTime,
|
|
77
|
+
updatedDate: updatedDateTime,
|
|
78
|
+
parentCommentId: blob.parentCommentId,
|
|
79
|
+
childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComment) : [],
|
|
80
|
+
user: createUser(blob.user),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export class FaveStyle {
|
|
84
|
+
constructor(fields) {
|
|
85
|
+
Object.assign(this, fields);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function createFaveStyle(blob) {
|
|
89
|
+
const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
|
|
90
|
+
const createdDateTime = createdDay && createdTime ? dayjs(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
|
|
91
|
+
const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
|
|
92
|
+
const updatedDateTime = updatedDay && updatedTime ? dayjs(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
|
|
93
|
+
const albumMedias = [createAlbumMedia(blob)].concat(blob.album_medias ? blob.album_medias.map(createAlbumMedia).filter(ap => ap.id !== blob.id) : []);
|
|
94
|
+
const { total_booked: totalBooked, total_like: totalLike, total_share: totalShare, total_view: totalView, } = blob.style_activity || {};
|
|
95
|
+
return new FaveStyle({
|
|
96
|
+
id: blob.id,
|
|
97
|
+
caption: blob.caption,
|
|
98
|
+
description: blob.description,
|
|
99
|
+
createdDate: createdDateTime,
|
|
100
|
+
updatedDate: updatedDateTime,
|
|
101
|
+
imageUrl: blob.full_image_url,
|
|
102
|
+
imageThumb: blob.full_image_url_thumb,
|
|
103
|
+
imageThumbMedium: blob.full_image_url_medium,
|
|
104
|
+
imageWidth: blob.img_w,
|
|
105
|
+
imageHeight: blob.img_h,
|
|
106
|
+
mediaType: blob.media_type,
|
|
107
|
+
isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
|
|
108
|
+
totalBooking: totalBooked || 0,
|
|
109
|
+
totalLike: totalLike || 0,
|
|
110
|
+
totalDislike: blob.total_dislike || 0,
|
|
111
|
+
totalShare: totalShare || 0,
|
|
112
|
+
totalView: totalView || 0,
|
|
113
|
+
albumMedias,
|
|
114
|
+
album: blob.album ? createAlbum(blob.album) : null,
|
|
115
|
+
owner: blob.user ? createUser(blob.user) : null,
|
|
116
|
+
salonId: blob.salon_id ? Number(blob.salon_id) : null,
|
|
117
|
+
salon: blob.salon ? createSalon(blob.salon) : null,
|
|
118
|
+
stylistId: blob.stylist_id ? Number(blob.stylist_id) : null,
|
|
119
|
+
stylist: blob.stylist ? createStylistFromLookbook(blob.stylist) : null,
|
|
120
|
+
isLiked: blob.my_activity && blob.my_activity.liked,
|
|
121
|
+
serviceId: blob.service_id ? Number(blob.service_id) : null,
|
|
122
|
+
salonServiceId: blob.category_service_id ? Number(blob.category_service_id) : null,
|
|
123
|
+
productBrand: blob.product_brand_used || '',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export function isVideoMedia({ mediaType }) {
|
|
127
|
+
return mediaType === MediaType.Video;
|
|
128
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function createStylist(blob) {
|
|
2
|
+
const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
|
|
3
|
+
const { first_name, last_name, mobile_phone, avatar, full_profile_image, } = blob.user || {};
|
|
4
|
+
const userNames = [first_name, last_name].filter(name => !!name);
|
|
5
|
+
return {
|
|
6
|
+
id: Number(blob.id),
|
|
7
|
+
firstName: first_name,
|
|
8
|
+
lastName: last_name,
|
|
9
|
+
fullName: userNames.length > 0 ? userNames.join(' ') : blob.email,
|
|
10
|
+
avatar: avatar || full_profile_image,
|
|
11
|
+
phone: mobile_phone,
|
|
12
|
+
expertise: Boolean(blob.expertise),
|
|
13
|
+
rating: Math.ceil((ratingPercentage * 5) / 100),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function createStylistFromLookbook(blob) {
|
|
17
|
+
const { user } = blob;
|
|
18
|
+
const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
|
|
19
|
+
const userNames = [user.first_name, user.last_name].filter(name => !!name);
|
|
20
|
+
return {
|
|
21
|
+
id: Number(blob.id),
|
|
22
|
+
firstName: user.first_name,
|
|
23
|
+
lastName: user.last_name,
|
|
24
|
+
fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.title),
|
|
25
|
+
avatar: user.full_avatar || user.full_profile_image_thumb,
|
|
26
|
+
phone: user.mobile_phone,
|
|
27
|
+
expertise: Boolean(blob.expertise),
|
|
28
|
+
rating: Math.ceil((ratingPercentage * 5) / 100),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function createUser(blob) {
|
|
2
|
+
const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
|
|
3
|
+
return {
|
|
4
|
+
id: blob.id || blob.user_id,
|
|
5
|
+
firstName: blob.first_name,
|
|
6
|
+
lastName: blob.last_name,
|
|
7
|
+
fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
|
|
8
|
+
avatar: blob.avatar || blob.full_profile_image_thumb,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Components, JSX } from "../types/components";
|
|
4
4
|
|
|
5
|
+
interface ChatButton extends Components.ChatButton, HTMLElement {}
|
|
6
|
+
export const ChatButton: {
|
|
7
|
+
prototype: ChatButton;
|
|
8
|
+
new (): ChatButton;
|
|
9
|
+
};
|
|
10
|
+
|
|
5
11
|
interface GoogleMap extends Components.GoogleMap, HTMLElement {}
|
|
6
12
|
export const GoogleMap: {
|
|
7
13
|
prototype: GoogleMap;
|
|
@@ -20,12 +26,6 @@ export const SalonBookingModal: {
|
|
|
20
26
|
new (): SalonBookingModal;
|
|
21
27
|
};
|
|
22
28
|
|
|
23
|
-
interface SalonContact extends Components.SalonContact, HTMLElement {}
|
|
24
|
-
export const SalonContact: {
|
|
25
|
-
prototype: SalonContact;
|
|
26
|
-
new (): SalonContact;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
29
|
interface SalonGiftCard extends Components.SalonGiftCard, HTMLElement {}
|
|
30
30
|
export const SalonGiftCard: {
|
|
31
31
|
prototype: SalonGiftCard;
|
|
@@ -50,6 +50,12 @@ export const SalonLatestReviews: {
|
|
|
50
50
|
new (): SalonLatestReviews;
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
interface SalonLatestStyles extends Components.SalonLatestStyles, HTMLElement {}
|
|
54
|
+
export const SalonLatestStyles: {
|
|
55
|
+
prototype: SalonLatestStyles;
|
|
56
|
+
new (): SalonLatestStyles;
|
|
57
|
+
};
|
|
58
|
+
|
|
53
59
|
interface SalonLocations extends Components.SalonLocations, HTMLElement {}
|
|
54
60
|
export const SalonLocations: {
|
|
55
61
|
prototype: SalonLocations;
|
|
@@ -86,18 +92,18 @@ export const SalonServices: {
|
|
|
86
92
|
new (): SalonServices;
|
|
87
93
|
};
|
|
88
94
|
|
|
89
|
-
interface SalonStyles extends Components.SalonStyles, HTMLElement {}
|
|
90
|
-
export const SalonStyles: {
|
|
91
|
-
prototype: SalonStyles;
|
|
92
|
-
new (): SalonStyles;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
95
|
interface SalonStylists extends Components.SalonStylists, HTMLElement {}
|
|
96
96
|
export const SalonStylists: {
|
|
97
97
|
prototype: SalonStylists;
|
|
98
98
|
new (): SalonStylists;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
interface StyleDetail extends Components.StyleDetail, HTMLElement {}
|
|
102
|
+
export const StyleDetail: {
|
|
103
|
+
prototype: StyleDetail;
|
|
104
|
+
new (): StyleDetail;
|
|
105
|
+
};
|
|
106
|
+
|
|
101
107
|
interface UserAvatar extends Components.UserAvatar, HTMLElement {}
|
|
102
108
|
export const UserAvatar: {
|
|
103
109
|
prototype: UserAvatar;
|