@homefile/components-v2 2.40.26 → 2.40.28

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.
@@ -1031,6 +1031,7 @@
1031
1031
  "editDetails": "Edit details",
1032
1032
  "editPhoto": "Edit photo",
1033
1033
  "editValue": "Edit value",
1034
+ "editMortgage": "Edit Mortgage",
1034
1035
  "folders": "Folders",
1035
1036
  "deleted": "Scheduled to be deleted",
1036
1037
  "help": "Help info",
@@ -1,20 +1,29 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from 'react';
3
2
  import { Stack, Text, useRadioGroup } from '@chakra-ui/react';
3
+ import { useEffect, useRef } from 'react';
4
4
  import { RadioCard } from '../../../components';
5
5
  export function ConfirmPropertyRecords({ onChange, title, subtitle, options, }) {
6
6
  var _a;
7
7
  const defaultValue = (_a = options[0]) === null || _a === void 0 ? void 0 : _a.id;
8
+ const onChangeRef = useRef(onChange);
9
+ useEffect(() => {
10
+ onChangeRef.current = onChange;
11
+ }, [onChange]);
12
+ const didInitRef = useRef(false);
13
+ useEffect(() => {
14
+ if (didInitRef.current)
15
+ return;
16
+ if (!defaultValue)
17
+ return;
18
+ onChangeRef.current(defaultValue);
19
+ didInitRef.current = true;
20
+ }, [defaultValue]);
8
21
  const { getRootProps, getRadioProps } = useRadioGroup({
9
22
  name: 'records',
10
23
  defaultValue,
11
- onChange: (value) => onChange(value),
24
+ onChange: (value) => onChangeRef.current(value),
12
25
  });
13
26
  const group = getRootProps();
14
- useEffect(() => {
15
- if (defaultValue)
16
- onChange(defaultValue);
17
- }, [defaultValue, onChange]);
18
27
  return (_jsxs(Stack, { spacing: "10", align: "center", children: [_jsxs(Stack, { spacing: "4", align: "center", children: [_jsx(Text, { fontSize: "lg", textAlign: "center", children: title }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: subtitle })] }), _jsx(Stack, Object.assign({}, group, { spacing: "1", w: "full", children: options.map(({ id, label }) => {
19
28
  const radio = getRadioProps({ value: id });
20
29
  return (_jsx(RadioCard, Object.assign({ variant: "bg-violet" }, radio, { children: _jsx(Text, { fontFamily: "secondary", children: label }) }), id));
@@ -5,5 +5,5 @@ import { Edit, EstRoi, Plus, TileCard, TileTooltip, TrendingLineChart, TrendingV
5
5
  import { ComputerReport } from '../../../assets/images';
6
6
  import { colors } from '../../../theme/colors';
7
7
  export const TrendingValue = ({ chartData, marketValue = 0, menuItems, mortgageBalance = 0, onMortgageClick, purchasePrice = 0, roi, showHelp }) => {
8
- return (_jsx(TileTooltip, { label: "trendingValue", children: _jsx(Box, { children: _jsxs(TileCard, { bg: "lightGreen.8", menuItems: menuItems, title: t('propertyTiles.trending.title'), icon: ComputerReport, fontWeight: "normal", showHelp: showHelp, children: [_jsxs(Flex, { gap: "base", p: "base", bg: "lightBlue.1", children: [_jsx(TrendingValueCard, { bg: "lightBlue.2", label: t('propertyTiles.trending.purchase'), value: purchasePrice }), (mortgageBalance > 0) ? (_jsx(TrendingValueCard, { bg: "lightBlue.4", editButton: Boolean(mortgageBalance) && (_jsx(Tooltip, { label: t('tooltips.editValue'), children: _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, { size: 16 }), onClick: onMortgageClick }) })), label: t('propertyTiles.trending.mortgage'), value: mortgageBalance })) : (_jsxs(Stack, { spacing: "1", flex: "auto", children: [_jsx(Flex, { align: "center", justify: "space-between", h: "20px", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('propertyTiles.trending.mortgage') }) }), _jsxs(Button, { variant: "tertiary", h: "full", onClick: onMortgageClick, w: "full", px: "1", children: [_jsx(Plus, { stroke: colors.blue[3], size: 20 }), _jsx(Text, { color: colors.blue[3], as: "span", pl: '.25rem', children: t('propertyTiles.trending.addMortgage') })] })] }))] }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsxs(Flex, { children: [_jsx(TrendingValueCard, { bg: "lightGreen.6", fontSize: "3xl", label: t('propertyTiles.trending.estimated'), value: marketValue }), roi && _jsx(EstRoi, { value: roi })] }), chartData && _jsx(TrendingLineChart, { data: chartData }), !chartData && (_jsx(Box, { h: "220px", border: "1px solid", borderColor: "lightGreen.6" })), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('propertyTiles.trending.public') })] })] }) }) }));
8
+ return (_jsx(TileTooltip, { label: "trendingValue", children: _jsx(Box, { children: _jsxs(TileCard, { bg: "lightGreen.8", menuItems: menuItems, title: t('propertyTiles.trending.title'), icon: ComputerReport, fontWeight: "normal", showHelp: showHelp, children: [_jsxs(Flex, { gap: "base", p: "base", bg: "lightBlue.1", children: [_jsx(TrendingValueCard, { bg: "lightBlue.2", label: t('propertyTiles.trending.purchase'), value: purchasePrice }), (mortgageBalance > 0) ? (_jsx(TrendingValueCard, { bg: "lightBlue.4", editButton: Boolean(mortgageBalance) && (_jsx(Tooltip, { label: t('tooltips.editMortgage'), children: _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, { size: 16 }), onClick: onMortgageClick }) })), label: t('propertyTiles.trending.mortgage'), value: mortgageBalance })) : (_jsxs(Stack, { spacing: "1", flex: "auto", children: [_jsx(Flex, { align: "center", justify: "space-between", h: "20px", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('propertyTiles.trending.mortgage') }) }), _jsxs(Button, { variant: "tertiary", h: "full", onClick: onMortgageClick, w: "full", px: "1", children: [_jsx(Plus, { stroke: colors.blue[3], size: 20 }), _jsx(Text, { color: colors.blue[3], as: "span", pl: '.25rem', children: t('propertyTiles.trending.addMortgage') })] })] }))] }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsxs(Flex, { children: [_jsx(TrendingValueCard, { bg: "lightGreen.6", fontSize: "3xl", label: t('propertyTiles.trending.estimated'), value: marketValue }), roi && _jsx(EstRoi, { value: roi })] }), chartData && _jsx(TrendingLineChart, { data: chartData }), !chartData && (_jsx(Box, { h: "220px", border: "1px solid", borderColor: "lightGreen.6" })), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('propertyTiles.trending.public') })] })] }) }) }));
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.40.26",
3
+ "version": "2.40.28",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",