@homefile/components-v2 2.7.19 → 2.7.21

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.
@@ -21,5 +21,5 @@ export const HomeCardWithRecipent = ({ address: { city, state, street, number =
21
21
  component: (_jsx(HomeCardRecipients, { recipients: recipients, menu: menu, onEditClick: handleEditAccountType })),
22
22
  }
23
23
  ];
24
- return (_jsxs(Container, { variant: "launchpad", children: [_jsx(HomeCard, { city: city, externalLink: externalLink, imageUrl: image, name: name, number: number, street: street, state: state, zip: zip, handleEditClick: () => handleEdit(_id), addImage: addImage, loading: loading, edit: !disabled }), _jsx(TabsHeader, { tabList: propertyDisabled ? noPropertyTabs : tabs }), _jsx(RightPanel, { isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: _jsx(EditAccountType, { associateAccount: editingAccountType, handleClose: onRightClose, handleDelete: handleDeleteAccountType, handleSubmit: handleSubmitAccountType, isLoading: loading }) })] }));
24
+ return (_jsxs(Container, { variant: "launchpad", children: [_jsx(HomeCard, { city: city, externalLink: externalLink, imageUrl: image, name: name, number: number, street: street, state: state, zip: zip, handleEditClick: () => handleEdit(_id), addImage: addImage, loading: loading, edit: !disabled }), _jsx(TabsHeader, { tabList: propertyDisabled ? noPropertyTabs : tabs }), (handleDeleteAccountType && handleSubmitAccountType) && (_jsx(RightPanel, { isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: _jsx(EditAccountType, { associateAccount: editingAccountType, handleClose: onRightClose, handleDelete: handleDeleteAccountType, handleSubmit: handleSubmitAccountType, isLoading: loading }) }))] }));
25
25
  };
@@ -17,8 +17,8 @@ export interface HomeCardWithRecipentI {
17
17
  externalLink?: string;
18
18
  _id: string;
19
19
  handleEdit: (id: string) => void;
20
- handleDeleteAccountType: (email: string) => void;
21
- handleSubmitAccountType: (form: AssociatedAccountI) => void;
20
+ handleDeleteAccountType?: (email: string) => void;
21
+ handleSubmitAccountType?: (form: AssociatedAccountI) => void;
22
22
  image?: ImageI | null;
23
23
  loading?: boolean;
24
24
  menu?: MenuItemI[];
@@ -7,7 +7,7 @@ export interface TwoFactorSettingI {
7
7
  defaultValue?: string;
8
8
  email?: string;
9
9
  loading?: boolean;
10
- onChange?: (value: string) => void;
10
+ onChange?: (value: 'email' | 'sms') => void;
11
11
  onSave: (value: TwoFactorFormI) => void;
12
12
  sms?: string;
13
13
  twoFactor?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.7.19",
3
+ "version": "2.7.21",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -92,16 +92,19 @@ export const HomeCardWithRecipent = ({
92
92
  />
93
93
 
94
94
  <TabsHeader tabList={propertyDisabled ? noPropertyTabs : tabs} />
95
-
96
- <RightPanel isOpen={isRightOpen} onClose={onRightClose} size={panelSize}>
97
- <EditAccountType
98
- associateAccount={editingAccountType}
99
- handleClose={onRightClose}
100
- handleDelete={handleDeleteAccountType}
101
- handleSubmit={handleSubmitAccountType}
102
- isLoading={loading}
103
- />
104
- </RightPanel>
95
+ {
96
+ (handleDeleteAccountType && handleSubmitAccountType) && (
97
+ <RightPanel isOpen={isRightOpen} onClose={onRightClose} size={panelSize}>
98
+ <EditAccountType
99
+ associateAccount={editingAccountType}
100
+ handleClose={onRightClose}
101
+ handleDelete={handleDeleteAccountType}
102
+ handleSubmit={handleSubmitAccountType}
103
+ isLoading={loading}
104
+ />
105
+ </RightPanel>
106
+ )
107
+ }
105
108
  </Container>
106
109
  )
107
110
  }
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react'
1
+ import { useEffect } from 'react'
2
2
  import { useRadioGroup } from '@chakra-ui/react'
3
3
  import { useForm } from 'react-hook-form'
4
4
  import * as yup from 'yup'
@@ -15,7 +15,7 @@ export const useTwoFactorSetting = ({
15
15
  }: Partial<TwoFactorSettingI>) => {
16
16
  const altText = getIconAltText(Security)
17
17
 
18
- const handleRadioChange = (value: string) => {
18
+ const handleRadioChange = (value: 'email' | 'sms') => {
19
19
  onChange?.(value)
20
20
  }
21
21
 
@@ -56,7 +56,8 @@ export const useTwoFactorSetting = ({
56
56
  const isSmsChanged = smsValue !== sms
57
57
  const radioChanged = radioValue !== defaultValue && is2faEnabled
58
58
 
59
- const showButtons = isSwitchChanged || isEmailChanged || isSmsChanged || radioChanged
59
+ const showButtons =
60
+ isSwitchChanged || isEmailChanged || isSmsChanged || radioChanged
60
61
 
61
62
  const handlePhoneValidation = (value?: string): boolean => {
62
63
  if (radioValue === 'sms')
@@ -24,8 +24,8 @@ export interface HomeCardWithRecipentI {
24
24
  externalLink?: string
25
25
  _id: string
26
26
  handleEdit: (id: string) => void
27
- handleDeleteAccountType: (email: string) => void
28
- handleSubmitAccountType: (form: AssociatedAccountI) => void
27
+ handleDeleteAccountType?: (email: string) => void
28
+ handleSubmitAccountType?: (form: AssociatedAccountI) => void
29
29
  image?: ImageI | null
30
30
  loading?: boolean
31
31
  menu?: MenuItemI[]
@@ -8,7 +8,7 @@ export interface TwoFactorSettingI {
8
8
  defaultValue?: string
9
9
  email?: string
10
10
  loading?: boolean
11
- onChange?: (value: string) => void
11
+ onChange?: (value: 'email' | 'sms') => void
12
12
  onSave: (value: TwoFactorFormI) => void
13
13
  sms?: string
14
14
  twoFactor?: string