@xyo-network/react-address-render 2.47.2 → 2.47.3

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.
@@ -6,11 +6,11 @@ import { useXyoEvent } from '@xyo-network/react-event';
6
6
  import { EllipsizeBox, useShareForwardedRef } from '@xyo-network/react-shared';
7
7
  import { forwardRef } from 'react';
8
8
  import { FavoriteIconButton } from './favorite';
9
- export const AddressRenderRowBox = forwardRef(({ address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, showFavorite = false, ...props }, ref) => {
9
+ export const AddressRenderRowBox = forwardRef(({ address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
10
10
  const theme = useTheme();
11
11
  const sharedRef = useShareForwardedRef(ref);
12
12
  const [elementRef, dispatch] = useXyoEvent(undefined, sharedRef);
13
- return (_jsxs(FlexGrowRow, { gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => (address ? dispatch('address', 'click', address) : undefined), ...props, children: [icons && address ? (_jsx(ListItemIcon, { sx: { minWidth: 0 }, children: _jsx(Identicon, { size: iconSize, value: address }) })) : null, iconOnly ? null : (_jsx(ListItemText, { children: _jsx(EllipsizeBox, { ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize }, children: address }) })), children, showFavorite && address ? _jsx(FavoriteIconButton, { size: 'small', address: address, favorite: favoriteProp }) : null] }));
13
+ return (_jsxs(FlexGrowRow, { gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => (address ? dispatch('address', 'click', address) : undefined), ...props, children: [icons && address ? (_jsx(ListItemIcon, { sx: { minWidth: 0 }, children: _jsx(Identicon, { size: iconSize, value: address }) })) : null, iconOnly ? null : (_jsx(ListItemText, { children: _jsx(EllipsizeBox, { ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize }, children: name ?? address }) })), children, showFavorite && address ? _jsx(FavoriteIconButton, { size: 'small', address: address, favorite: favoriteProp }) : null] }));
14
14
  });
15
15
  AddressRenderRowBox.displayName = 'AddressRenderRowBox';
16
16
  //# sourceMappingURL=RenderRowBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAa/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAC3C,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,GAAG,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC7H,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAC3C,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAEhE,OAAO,CACL,MAAC,WAAW,IACV,GAAG,EAAE,CAAC,EACN,cAAc,EAAC,YAAY,EAC3B,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,OAA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,QAAQ,EACR,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,KAAC,kBAAkB,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,IAAI,IACrG,CACf,CAAA;AACH,CAAC,CACF,CAAA;AAED,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA"}
@@ -7,6 +7,7 @@ export interface AddressRenderRowBoxPropsBase {
7
7
  iconOnly?: boolean;
8
8
  iconSize?: number;
9
9
  icons?: boolean;
10
+ name?: string;
10
11
  showFavorite?: boolean;
11
12
  }
12
13
  export interface AddressRenderRowBoxProps extends WithChildren, AddressRenderRowBoxPropsBase, FlexBoxProps {
@@ -1 +1 @@
1
- {"version":3,"file":"RenderRowBox.d.ts","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAe,MAAM,uBAAuB,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOnD,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,YAAY,EAAE,4BAA4B,EAAE,YAAY;CAAG;AAE7G,eAAO,MAAM,mBAAmB,kHAgC/B,CAAA"}
1
+ {"version":3,"file":"RenderRowBox.d.ts","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAe,MAAM,uBAAuB,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOnD,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,YAAY,EAAE,4BAA4B,EAAE,YAAY;CAAG;AAE7G,eAAO,MAAM,mBAAmB,kHAgC/B,CAAA"}
package/package.json CHANGED
@@ -13,8 +13,8 @@
13
13
  "@xylabs/react-flexbox": "^2.16.11",
14
14
  "@xylabs/react-identicon": "^2.16.11",
15
15
  "@xylabs/react-shared": "^2.16.11",
16
- "@xyo-network/react-event": "^2.47.2",
17
- "@xyo-network/react-shared": "^2.47.2"
16
+ "@xyo-network/react-event": "^2.47.3",
17
+ "@xyo-network/react-shared": "^2.47.3"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mui/icons-material": "^5",
@@ -76,5 +76,5 @@
76
76
  },
77
77
  "sideEffects": false,
78
78
  "types": "dist/types/index.d.ts",
79
- "version": "2.47.2"
79
+ "version": "2.47.3"
80
80
  }
@@ -14,13 +14,14 @@ export interface AddressRenderRowBoxPropsBase {
14
14
  iconOnly?: boolean
15
15
  iconSize?: number
16
16
  icons?: boolean
17
+ name?: string
17
18
  showFavorite?: boolean
18
19
  }
19
20
 
20
21
  export interface AddressRenderRowBoxProps extends WithChildren, AddressRenderRowBoxPropsBase, FlexBoxProps {}
21
22
 
22
23
  export const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxProps>(
23
- ({ address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, showFavorite = false, ...props }, ref) => {
24
+ ({ address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
24
25
  const theme = useTheme()
25
26
 
26
27
  const sharedRef = useShareForwardedRef(ref)
@@ -42,7 +43,7 @@ export const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxPr
42
43
  {iconOnly ? null : (
43
44
  <ListItemText>
44
45
  <EllipsizeBox ellipsisPosition={'end'} width="100%" typographyProps={{ fontSize: theme.typography.body1.fontSize }}>
45
- {address}
46
+ {name ?? address}
46
47
  </EllipsizeBox>
47
48
  </ListItemText>
48
49
  )}