@homefile/components-v2 2.51.0 → 2.51.2
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/dist/assets/locales/en/index.json +1 -1
- package/dist/components/partner/wizardSteps/PartnerWizardStepServicesSelect.d.ts +2 -1
- package/dist/components/partner/wizardSteps/PartnerWizardStepServicesSelect.js +8 -11
- package/dist/interfaces/partner/PartnerWizardStepServicesSelect.interface.d.ts +11 -0
- package/dist/interfaces/partner/PartnerWizardStepServicesSelect.interface.js +1 -0
- package/dist/interfaces/partner/index.d.ts +1 -0
- package/dist/interfaces/partner/index.js +1 -0
- package/dist/stories/partner/wizardSteps/PartnerWizardStepsBlocks.stories.js +10 -1
- package/package.json +1 -1
|
@@ -793,7 +793,7 @@
|
|
|
793
793
|
"subtitle": "Add up to 6 services. Keep names short and clear so homeowners can easily\n understand your offerings.",
|
|
794
794
|
"servicePlaceholder": "Service {{index}}",
|
|
795
795
|
"singleTitle": "2. Select your Primary Service and Category",
|
|
796
|
-
"singleSubtitle": "Choose one primary service and one category so homeowners
|
|
796
|
+
"singleSubtitle": "Choose one primary service and one category so homeowners \ncan quickly understand what you offer.",
|
|
797
797
|
"singleServiceLabel": "Primary Service",
|
|
798
798
|
"singleServicePlaceholder": "Select a service",
|
|
799
799
|
"singleCategoryLabel": "Category",
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { PartnerWizardStepServicesSelectI } from '../../../interfaces';
|
|
2
|
+
export declare const PartnerWizardStepServicesSelect: ({ value, onChange, isDisabled, categoryError, serviceError, }: PartnerWizardStepServicesSelectI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
2
|
import { t } from 'i18next';
|
|
4
3
|
import { Stack, Text } from '@chakra-ui/react';
|
|
5
4
|
import { SelectInput } from '../../../components';
|
|
@@ -49,18 +48,16 @@ const getOptionLabel = (options, selectedId) => {
|
|
|
49
48
|
return '';
|
|
50
49
|
return (_b = (_a = options.find((option) => option._id === selectedId)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
|
|
51
50
|
};
|
|
52
|
-
export const PartnerWizardStepServicesSelect = () => {
|
|
53
|
-
const [selectedService, setSelectedService] = useState('');
|
|
54
|
-
const [selectedCategory, setSelectedCategory] = useState('');
|
|
51
|
+
export const PartnerWizardStepServicesSelect = ({ value, onChange, isDisabled = false, categoryError, serviceError, }) => {
|
|
55
52
|
const categoryOptions = buildOptions('category', CATEGORY_IDS);
|
|
56
53
|
const serviceOptions = buildOptions('service', SERVICE_IDS);
|
|
57
|
-
return (_jsxs(PartnerWizardStepLayout, { title: t(`${STEP_KEY}.singleTitle`), subtitle: t(`${STEP_KEY}.singleSubtitle`), contentSpacing: "3", contentFullWidth: true, children: [_jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.singleCategoryLabel`) }), _jsx(SelectInput, { items: categoryOptions, initialValue: getOptionLabel(categoryOptions,
|
|
58
|
-
if (typeof
|
|
54
|
+
return (_jsxs(PartnerWizardStepLayout, { title: t(`${STEP_KEY}.singleTitle`), subtitle: t(`${STEP_KEY}.singleSubtitle`), contentSpacing: "3", contentFullWidth: true, children: [_jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.singleCategoryLabel`) }), _jsx(SelectInput, { items: categoryOptions, initialValue: getOptionLabel(categoryOptions, value.category), placeholder: t(`${STEP_KEY}.singleCategoryPlaceholder`), isDisabled: isDisabled, handleClick: (selectedOption) => {
|
|
55
|
+
if (typeof selectedOption === 'string')
|
|
59
56
|
return;
|
|
60
|
-
|
|
61
|
-
}, width: "100%" })] }), _jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.singleServiceLabel`) }), _jsx(SelectInput, { items: serviceOptions, initialValue: getOptionLabel(serviceOptions,
|
|
62
|
-
if (typeof
|
|
57
|
+
onChange(Object.assign(Object.assign({}, value), { category: String(selectedOption._id) }));
|
|
58
|
+
}, width: "100%" }), categoryError && _jsx(Text, { variant: "error", children: categoryError })] }), _jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "xs", mb: "1", textTransform: "uppercase", children: t(`${STEP_KEY}.singleServiceLabel`) }), _jsx(SelectInput, { items: serviceOptions, initialValue: getOptionLabel(serviceOptions, value.service), placeholder: t(`${STEP_KEY}.singleServicePlaceholder`), isDisabled: isDisabled, handleClick: (selectedOption) => {
|
|
59
|
+
if (typeof selectedOption === 'string')
|
|
63
60
|
return;
|
|
64
|
-
|
|
65
|
-
}, width: "100%" })] })] }));
|
|
61
|
+
onChange(Object.assign(Object.assign({}, value), { service: String(selectedOption._id) }));
|
|
62
|
+
}, width: "100%" }), serviceError && _jsx(Text, { variant: "error", children: serviceError })] })] }));
|
|
66
63
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ServicesSelectValue = {
|
|
2
|
+
category: string;
|
|
3
|
+
service: string;
|
|
4
|
+
};
|
|
5
|
+
export type PartnerWizardStepServicesSelectI = {
|
|
6
|
+
value: ServicesSelectValue;
|
|
7
|
+
onChange: (next: ServicesSelectValue) => void;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
categoryError?: string;
|
|
10
|
+
serviceError?: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,3 +18,4 @@ export * from './PartnerServiceTicketsWrapper.interface';
|
|
|
18
18
|
export * from './PartnerServiceTicketsToolbar.interface';
|
|
19
19
|
export * from './ShortPartnerTile.interface';
|
|
20
20
|
export * from './PartnerWizardSteps.interface';
|
|
21
|
+
export * from './PartnerWizardStepServicesSelect.interface';
|
|
@@ -18,3 +18,4 @@ export * from './PartnerServiceTicketsWrapper.interface';
|
|
|
18
18
|
export * from './PartnerServiceTicketsToolbar.interface';
|
|
19
19
|
export * from './ShortPartnerTile.interface';
|
|
20
20
|
export * from './PartnerWizardSteps.interface';
|
|
21
|
+
export * from './PartnerWizardStepServicesSelect.interface';
|
|
@@ -10,7 +10,16 @@ export default {
|
|
|
10
10
|
],
|
|
11
11
|
};
|
|
12
12
|
export const Services = () => _jsx(PartnerWizardStepServices, {});
|
|
13
|
-
export const ServicesSelect = () =>
|
|
13
|
+
export const ServicesSelect = () => {
|
|
14
|
+
const [value, setValue] = useState({
|
|
15
|
+
category: '',
|
|
16
|
+
service: '',
|
|
17
|
+
});
|
|
18
|
+
return (_jsx(PartnerWizardStepServicesSelect, { value: value, onChange: (next) => {
|
|
19
|
+
setValue(next);
|
|
20
|
+
action('onServicesSelectChange')(next);
|
|
21
|
+
} }));
|
|
22
|
+
};
|
|
14
23
|
export const ServiceZones = () => _jsx(PartnerWizardStepServiceZones, {});
|
|
15
24
|
export const Cta = () => _jsx(PartnerWizardStepCta, {});
|
|
16
25
|
export const Social = () => _jsx(PartnerWizardStepSocial, {});
|