favesalon-embed 0.0.4 → 0.1.0
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/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
- package/dist/cjs/colors-38421769.js +69 -0
- package/dist/cjs/favesalon-embed.cjs.js +20 -0
- package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
- package/dist/cjs/google-map_5.cjs.entry.js +291 -0
- package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
- package/{cjs/index-d5de0b9d.js → dist/cjs/index-e6bea8f5.js} +10 -0
- package/{cjs → dist/cjs}/index.cjs.js +0 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +5 -5
- package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +6 -7
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
- package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +7 -7
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
- package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +23 -57
- package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
- package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
- package/dist/cjs/salon-services.cjs.entry.js +78 -0
- package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
- package/{cjs/services-f1102d4a.js → dist/cjs/services-eee8f251.js} +265 -393
- package/dist/cjs/style-detail.cjs.entry.js +310 -0
- package/dist/cjs/user-avatar.cjs.entry.js +41 -0
- package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
- package/{collection → dist/collection}/collection-manifest.json +2 -3
- 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 +86 -0
- package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
- package/{collection → dist/collection}/components/salon-booking/index.js +3 -3
- package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +4 -4
- package/dist/collection/components/salon-gift-card/index.css +25 -0
- package/{collection → dist/collection}/components/salon-gift-card/index.js +4 -3
- package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +24 -3
- package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
- package/{collection → dist/collection}/components/salon-info/index.js +6 -32
- package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
- package/dist/collection/components/salon-latest-reviews/index.js +176 -0
- package/dist/collection/components/salon-latest-styles/index.css +10 -0
- package/dist/collection/components/salon-latest-styles/index.js +178 -0
- package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
- package/dist/collection/components/salon-locations/index.js +151 -0
- package/{collection → dist/collection}/components/salon-lookbook/index.css +0 -9
- package/{collection → dist/collection}/components/salon-lookbook/index.js +19 -19
- package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
- package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
- package/{collection → dist/collection}/components/salon-reviews/index.css +0 -0
- package/dist/collection/components/salon-reviews/index.js +286 -0
- package/dist/collection/components/salon-schedules/index.css +15 -0
- package/dist/collection/components/salon-schedules/index.js +189 -0
- package/{collection → dist/collection}/components/salon-services/index.css +0 -0
- package/{collection → dist/collection}/components/salon-services/index.js +51 -8
- package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
- package/dist/collection/components/salon-stylists/index.js +183 -0
- package/dist/collection/components/style-detail/index.css +62 -0
- package/dist/collection/components/style-detail/index.js +461 -0
- package/{collection → dist/collection}/components/user-avatar/index.css +0 -0
- package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
- package/dist/collection/constants/colors.js +65 -0
- package/{collection → dist/collection}/global/global.js +0 -0
- package/{collection → dist/collection}/index.js +0 -0
- package/dist/collection/services/services.js +174 -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/{collection → dist/collection}/types/service.js +0 -0
- package/dist/collection/types/style.js +128 -0
- package/{collection → dist/collection}/types/stylist.js +12 -9
- package/{favesalon-embed/index.esm.js → dist/collection/types/tmp.js} +0 -0
- package/{collection → dist/collection}/types/user.js +2 -2
- package/{collection → dist/collection}/utils/utils.js +0 -0
- package/{custom-elements → dist/custom-elements}/index.d.ts +12 -18
- package/{custom-elements → dist/custom-elements}/index.js +1227 -1035
- package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
- package/dist/esm/colors-ea36347a.js +67 -0
- package/dist/esm/favesalon-embed.js +18 -0
- package/{esm → dist/esm}/global-e1089ffd.js +0 -0
- package/dist/esm/google-map_5.entry.js +283 -0
- package/{esm/index-0f8eed73.js → dist/esm/index-6af0a03d.js} +10 -1
- package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
- package/{esm → dist/esm}/index.js +0 -0
- package/dist/esm/loader.js +18 -0
- package/{esm → dist/esm}/polyfills/core-js.js +0 -0
- package/{esm → dist/esm}/polyfills/css-shim.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/{esm → dist/esm}/salon-booking-modal.entry.js +5 -5
- package/{esm → dist/esm}/salon-booking.entry.js +5 -6
- package/dist/esm/salon-gift-card-modal.entry.js +24 -0
- package/{esm → dist/esm}/salon-gift-card.entry.js +6 -6
- package/dist/esm/salon-latest-reviews.entry.js +91 -0
- package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +24 -57
- package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
- package/dist/esm/salon-reviews.entry.js +182 -0
- package/dist/esm/salon-services.entry.js +74 -0
- package/dist/esm/salon-stylists.entry.js +108 -0
- package/{esm/services-74d84ca9.js → dist/esm/services-295247b1.js} +263 -392
- package/dist/esm/style-detail.entry.js +306 -0
- package/dist/esm/user-avatar.entry.js +37 -0
- package/{esm → dist/esm}/utils-e97485e0.js +0 -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/index.esm.js +0 -0
- package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
- package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
- package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
- package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
- package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
- package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
- package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
- package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
- package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
- package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
- package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
- package/dist/favesalon-embed/p-a33331cc.js +1 -0
- package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
- package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
- package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
- package/dist/favesalon-embed/p-c2ecb365.js +1 -0
- package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
- package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
- package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
- package/dist/favesalon-embed/p-fc9a5551.js +6 -0
- package/{index.cjs.js → dist/index.cjs.js} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/dist/types/components/google-map/index.d.ts +5 -0
- package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
- package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
- package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
- package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -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 +3 -3
- package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
- 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/user-avatar/index.d.ts +0 -0
- package/{types → dist/types}/components.d.ts +54 -59
- package/dist/types/constants/colors.d.ts +65 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/dist/types/services/services.d.ts +60 -0
- package/{types → dist/types}/stencil-public-runtime.d.ts +0 -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/{types → dist/types}/types/service.d.ts +0 -0
- package/dist/types/types/style.d.ts +88 -0
- package/{types → dist/types}/types/stylist.d.ts +1 -1
- package/dist/types/types/tmp.d.ts +0 -0
- package/{types → dist/types}/types/user.d.ts +2 -2
- package/{types → dist/types}/utils/utils.d.ts +0 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +18 -13
- package/readme.md +24 -7
- package/cjs/colors-7f354880.js +0 -95
- package/cjs/favesalon-embed.cjs.js +0 -20
- package/cjs/google-map.cjs.entry.js +0 -47
- package/cjs/index-95daad08.js +0 -1928
- package/cjs/loader.cjs.js +0 -22
- package/cjs/salon-contact_4.cjs.entry.js +0 -155
- package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
- package/cjs/salon-info.cjs.entry.js +0 -35
- package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
- package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
- package/cjs/salon-reviews.cjs.entry.js +0 -205
- package/cjs/salon-services.cjs.entry.js +0 -47
- package/cjs/salon-stylists.cjs.entry.js +0 -54
- package/collection/components/google-map/index.js +0 -97
- package/collection/components/salon-contact/index.js +0 -88
- package/collection/components/salon-gift-card/index.css +0 -25
- package/collection/components/salon-info/index.css +0 -3
- package/collection/components/salon-latest-reviews/index.js +0 -108
- package/collection/components/salon-locations/index.js +0 -80
- package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
- package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
- package/collection/components/salon-reviews/index.js +0 -317
- package/collection/components/salon-schedules/index.css +0 -14
- package/collection/components/salon-schedules/index.js +0 -103
- 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/constants/colors.js +0 -91
- package/collection/services/services.js +0 -225
- package/collection/types/common.js +0 -2
- package/collection/types/salon.js +0 -52
- package/collection/types/style.js +0 -103
- package/esm/colors-1ec90c5f.js +0 -93
- package/esm/favesalon-embed.js +0 -18
- package/esm/google-map.entry.js +0 -43
- package/esm/index-09d43e3e.js +0 -1926
- package/esm/loader.js +0 -18
- package/esm/salon-contact_4.entry.js +0 -148
- package/esm/salon-gift-card-modal.entry.js +0 -21
- package/esm/salon-info.entry.js +0 -31
- package/esm/salon-latest-reviews.entry.js +0 -54
- package/esm/salon-lookbook-modal.entry.js +0 -137
- package/esm/salon-reviews.entry.js +0 -201
- package/esm/salon-services.entry.js +0 -43
- package/esm/salon-stylists.entry.js +0 -50
- package/favesalon-embed/favesalon-embed.esm.js +0 -1
- package/favesalon-embed/p-0188d4dc.entry.js +0 -1
- package/favesalon-embed/p-0318501e.js +0 -1
- package/favesalon-embed/p-078f242d.entry.js +0 -1
- package/favesalon-embed/p-13e23c61.entry.js +0 -1
- package/favesalon-embed/p-17df13ad.js +0 -1
- package/favesalon-embed/p-1a3179c8.entry.js +0 -1
- package/favesalon-embed/p-20aa75de.js +0 -6
- package/favesalon-embed/p-2901a6d6.entry.js +0 -1
- package/favesalon-embed/p-2b861430.entry.js +0 -1
- package/favesalon-embed/p-44d810a0.js +0 -1
- package/favesalon-embed/p-4c68700f.entry.js +0 -1
- package/favesalon-embed/p-4e2d7b29.js +0 -1
- package/favesalon-embed/p-6b845bf1.entry.js +0 -1
- package/favesalon-embed/p-7350f6b5.entry.js +0 -1
- package/favesalon-embed/p-897c2b1c.entry.js +0 -1
- package/favesalon-embed/p-8e60f56f.entry.js +0 -1
- package/favesalon-embed/p-a49afdc1.entry.js +0 -1
- package/favesalon-embed/p-c93867c4.entry.js +0 -1
- package/favesalon-embed/p-ea6a097f.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-lookbook/salon-lookbook-modal.d.ts +0 -13
- package/types/components/salon-reviews/index.d.ts +0 -24
- 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 -26
- package/types/types/common.d.ts +0 -2
- package/types/types/style.d.ts +0 -59
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-6af0a03d.js';
|
|
2
|
+
import { H as HttpService, a as sortBy_1 } from './services-295247b1.js';
|
|
3
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
4
|
+
import './_commonjsHelpers-098d5b27.js';
|
|
5
|
+
|
|
6
|
+
const indexCss = "";
|
|
7
|
+
|
|
8
|
+
let SalonServices = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.buttonClass = 'btn btn-light';
|
|
12
|
+
}
|
|
13
|
+
componentWillLoad() {
|
|
14
|
+
this.fetchData();
|
|
15
|
+
}
|
|
16
|
+
async fetchData() {
|
|
17
|
+
this.isLoading = true;
|
|
18
|
+
try {
|
|
19
|
+
this.salonServices = await HttpService().fetchSalonServices(this.salonId);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
this.salonServices = [];
|
|
23
|
+
}
|
|
24
|
+
this.isLoading = false;
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
if (this.isLoading) {
|
|
28
|
+
return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray01}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index) => (h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
29
|
+
backgroundColor: Colors.Gray02,
|
|
30
|
+
float: 'left',
|
|
31
|
+
marginRight: '12px',
|
|
32
|
+
height: '30px',
|
|
33
|
+
width: '120px',
|
|
34
|
+
} })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index) => {
|
|
35
|
+
return (h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
36
|
+
backgroundColor: Colors.Gray03,
|
|
37
|
+
height: '20px',
|
|
38
|
+
width: '120px',
|
|
39
|
+
} }), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray01}`, marginTop: '12px' } }, h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
|
|
40
|
+
marginTop: '12px',
|
|
41
|
+
paddingTop: '12px',
|
|
42
|
+
borderTop: `1px solid ${Colors.Gray01}`,
|
|
43
|
+
} : {}) }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
|
|
44
|
+
backgroundColor: Colors.Gray01,
|
|
45
|
+
height: '16px',
|
|
46
|
+
width: '120px',
|
|
47
|
+
} })), h("div", { style: { marginTop: '4px' } }, h("div", { style: {
|
|
48
|
+
backgroundColor: Colors.Gray01,
|
|
49
|
+
height: '16px',
|
|
50
|
+
width: '240px',
|
|
51
|
+
} })))))))));
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap' } }, sortBy_1(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("a", { href: `#service-group--${serviceGroup.id}` }, h("button", { type: "button", class: this.buttonClass, style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), sortBy_1(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
|
|
55
|
+
const hasMultipleCates = (serviceGroup.data || []).length > 1;
|
|
56
|
+
return (h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" }, hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
|
|
57
|
+
marginTop: '12px',
|
|
58
|
+
paddingTop: '12px',
|
|
59
|
+
borderTop: `1px solid ${Colors.Gray01}`,
|
|
60
|
+
} : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (h("div", { style: {
|
|
61
|
+
display: 'block',
|
|
62
|
+
marginTop: '4px',
|
|
63
|
+
fontSize: '90%',
|
|
64
|
+
color: Colors.Gray05,
|
|
65
|
+
} }, [
|
|
66
|
+
!service.hideDuration ? `${service.duration} mins` : '',
|
|
67
|
+
!service.hidePrice ? `$${service.price}` : '',
|
|
68
|
+
].filter(field => !!field).join(' · ')))))))))))));
|
|
69
|
+
})));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
SalonServices.style = indexCss;
|
|
73
|
+
|
|
74
|
+
export { SalonServices as salon_services };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-6af0a03d.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-295247b1.js';
|
|
4
|
+
import './_commonjsHelpers-098d5b27.js';
|
|
5
|
+
|
|
6
|
+
const indexCss = ".view--salon-stylists{overflow:hidden;margin-left:-12px;margin-top:-12px}.view--salon-stylists .salon-stylist{float:left;padding-left:12px;padding-top:12px;width:50%}.view--salon-stylists .salon-stylist--avatar{height:180px}@media (min-width: 576px){.view--salon-stylists .salon-stylist{width:33.33%;max-width:240px}}@media (min-width: 768px){.view--salon-stylists{margin-left:-24px;margin-top:-24px}.view--salon-stylists .salon-stylist{padding-left:24px;padding-top:24px;width:264px;max-width:none}.view--salon-stylists .salon-stylist--avatar{height:240px}}";
|
|
7
|
+
|
|
8
|
+
const pageLimit = 20;
|
|
9
|
+
let SalonStylists = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
this.page = 1;
|
|
13
|
+
}
|
|
14
|
+
componentWillLoad() {
|
|
15
|
+
this.fetchData();
|
|
16
|
+
}
|
|
17
|
+
async fetchData() {
|
|
18
|
+
this.isLoading = true;
|
|
19
|
+
try {
|
|
20
|
+
const { total, data } = await HttpService().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
|
|
21
|
+
this.totalStylists = total;
|
|
22
|
+
this.salonStylists = data;
|
|
23
|
+
this.canLoadMore = data.length === pageLimit;
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
this.totalStylists = 0;
|
|
27
|
+
this.salonStylists = [];
|
|
28
|
+
this.canLoadMore = false;
|
|
29
|
+
}
|
|
30
|
+
this.isLoading = false;
|
|
31
|
+
}
|
|
32
|
+
async onLoadMore() {
|
|
33
|
+
this.isLoadingMore = true;
|
|
34
|
+
try {
|
|
35
|
+
const { data } = await HttpService().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
|
|
36
|
+
this.salonStylists = this.salonStylists.concat(data || []);
|
|
37
|
+
this.canLoadMore = data.length === pageLimit;
|
|
38
|
+
this.page += 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) { }
|
|
41
|
+
this.isLoadingMore = false;
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
if (this.isLoading) {
|
|
45
|
+
return (h("div", null, h("div", { class: "view--salon-stylists" }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((fakeId, index) => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
|
|
46
|
+
background: 'none',
|
|
47
|
+
border: 'none',
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
} }, h("div", { class: "salon-stylist--avatar", style: {
|
|
50
|
+
backgroundColor: Colors.Gray01,
|
|
51
|
+
backgroundRepeat: 'no-repeat',
|
|
52
|
+
backgroundPosition: 'center top',
|
|
53
|
+
backgroundSize: 'cover',
|
|
54
|
+
border: `1px solid ${Colors.Gray01}`,
|
|
55
|
+
borderRadius: '8px',
|
|
56
|
+
position: 'relative',
|
|
57
|
+
display: 'flex',
|
|
58
|
+
width: '100%',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
justifyContent: 'center',
|
|
61
|
+
} }), h("div", { class: "card-body" }, h("div", { key: `stylist--${fakeId}--${index}`, style: {
|
|
62
|
+
backgroundColor: Colors.Gray01,
|
|
63
|
+
height: '16px',
|
|
64
|
+
width: '120px',
|
|
65
|
+
margin: 'auto',
|
|
66
|
+
} })))))))));
|
|
67
|
+
}
|
|
68
|
+
return (h("div", null, h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
|
|
69
|
+
background: 'none',
|
|
70
|
+
border: 'none',
|
|
71
|
+
overflow: 'hidden',
|
|
72
|
+
} }, h("div", { class: "salon-stylist--avatar", style: {
|
|
73
|
+
backgroundImage: `url("${stylist.avatar}")`,
|
|
74
|
+
backgroundColor: Colors.Gray01,
|
|
75
|
+
backgroundRepeat: 'no-repeat',
|
|
76
|
+
backgroundPosition: 'center top',
|
|
77
|
+
backgroundSize: 'cover',
|
|
78
|
+
border: `1px solid ${Colors.Gray01}`,
|
|
79
|
+
borderRadius: '8px',
|
|
80
|
+
position: 'relative',
|
|
81
|
+
display: 'flex',
|
|
82
|
+
width: '100%',
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
} }, !stylist.avatar && (h("span", { style: {
|
|
86
|
+
fontSize: '32px',
|
|
87
|
+
fontWeight: 'bold',
|
|
88
|
+
textTransform: 'uppercase',
|
|
89
|
+
} }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), h("div", { class: "card-body" }, h("div", { style: {
|
|
90
|
+
fontSize: '18px',
|
|
91
|
+
fontWeight: '600',
|
|
92
|
+
textAlign: 'center',
|
|
93
|
+
} }, stylist.fullName))))))), this.canLoadMore && (h("div", { class: "view-footer", style: {
|
|
94
|
+
textAlign: 'center',
|
|
95
|
+
paddingTop: '32px',
|
|
96
|
+
paddingBottom: '16px',
|
|
97
|
+
} }, h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
|
|
98
|
+
background: Colors.White,
|
|
99
|
+
border: `1px solid ${Colors.Gray02}`,
|
|
100
|
+
borderRadius: '4px',
|
|
101
|
+
paddingLeft: '24px',
|
|
102
|
+
paddingRight: '24px',
|
|
103
|
+
}, onClick: () => this.onLoadMore() }, "Load more")))));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
SalonStylists.style = indexCss;
|
|
107
|
+
|
|
108
|
+
export { SalonStylists as salon_stylists };
|