@homefile/components-v2 2.36.25 → 2.36.26

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.
@@ -22,9 +22,15 @@ export const ConfirmProperty = ({ handleAddress = () => { }, isFirstHome, isLoad
22
22
  if ((properties === null || properties === void 0 ? void 0 : properties.length) > 0) {
23
23
  setCurrentProperty(properties[0].id);
24
24
  }
25
+ else {
26
+ setCurrentProperty('none');
27
+ }
25
28
  }, [properties]);
29
+ const handleContinue = () => {
30
+ handleAddress === null || handleAddress === void 0 ? void 0 : handleAddress(currentProperty);
31
+ };
26
32
  if (isWizard) {
27
- return (_jsxs(Stack, { children: [_jsxs(Stack, { align: "center", borderRadius: "sm", w: "100%", py: "4", children: [_jsx(PropertyCards, { properties: propertiesWithNoneOfTheAbove, currentProperty: currentProperty, onChange: setCurrentProperty }), _jsx(Box, { px: "6", children: _jsx(Text, { variant: "home", textAlign: "center", children: footerText }) })] }), _jsx(Button, { onClick: () => handleAddress === null || handleAddress === void 0 ? void 0 : handleAddress(currentProperty), disabled: isLoading, children: t('buttons.continue') })] }));
33
+ return (_jsxs(Stack, { children: [_jsxs(Stack, { align: "center", borderRadius: "sm", w: "100%", py: "4", children: [_jsx(PropertyCards, { properties: propertiesWithNoneOfTheAbove, currentProperty: currentProperty, onChange: setCurrentProperty }), _jsx(Box, { px: "6", children: _jsx(Text, { variant: "home", textAlign: "center", children: footerText }) })] }), _jsx(Button, { onClick: handleContinue, disabled: isLoading, children: t('buttons.continue') })] }));
28
34
  }
29
- return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, children: _jsxs(MyHomesStepBody, { fadeDelay: 0, title: t('myHomes.properties.title'), subtitle: t('myHomes.properties.subtitle'), children: [_jsxs(Stack, { align: "center", bg: "lightViolet.1", borderRadius: "sm", w: "100%", py: "6", children: [_jsx(PropertyCards, { properties: propertiesWithNoneOfTheAbove, currentProperty: currentProperty, onChange: setCurrentProperty }), _jsx(Box, { px: "6", children: _jsx(Text, { variant: "home", textAlign: "center", children: footerText }) })] }), _jsx(Button, { onClick: () => handleAddress === null || handleAddress === void 0 ? void 0 : handleAddress(currentProperty), disabled: isLoading, children: t('buttons.continue') })] }) }));
35
+ return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, children: _jsxs(MyHomesStepBody, { fadeDelay: 0, title: t('myHomes.properties.title'), subtitle: t('myHomes.properties.subtitle'), children: [_jsxs(Stack, { align: "center", bg: "lightViolet.1", borderRadius: "sm", w: "100%", py: "6", children: [_jsx(PropertyCards, { properties: propertiesWithNoneOfTheAbove, currentProperty: currentProperty, onChange: setCurrentProperty }), _jsx(Box, { px: "6", children: _jsx(Text, { variant: "home", textAlign: "center", children: footerText }) })] }), _jsx(Button, { onClick: handleContinue, disabled: isLoading, children: t('buttons.continue') })] }) }));
30
36
  };
@@ -2,13 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRadioGroup, Stack, Text } from '@chakra-ui/react';
3
3
  import { RadioCard } from '../../../components';
4
4
  export const PropertyCards = ({ properties, currentProperty, onChange, }) => {
5
+ var _a;
5
6
  const { getRootProps, getRadioProps } = useRadioGroup({
6
7
  name: 'properties',
7
- defaultValue: currentProperty,
8
+ value: currentProperty,
8
9
  onChange,
9
10
  });
10
11
  const group = getRootProps();
11
- const hasProperties = (properties === null || properties === void 0 ? void 0 : properties.length) && (properties === null || properties === void 0 ? void 0 : properties.length) > 1;
12
+ const hasProperties = ((_a = properties === null || properties === void 0 ? void 0 : properties.length) !== null && _a !== void 0 ? _a : 0) > 0;
12
13
  if (!hasProperties)
13
14
  return null;
14
15
  return (_jsx(Stack, Object.assign({}, group, { spacing: "base", p: "6", w: "100%", children: properties === null || properties === void 0 ? void 0 : properties.map(({ id, address: { address } }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.36.25",
3
+ "version": "2.36.26",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",