react-mention-input 1.0.14 → 1.0.15

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.
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import './ShowMessageCard.css';
3
3
  export var ShowMessageCard = function (_a) {
4
4
  var data = _a.data, _b = _a.nameKey, nameKey = _b === void 0 ? 'name' : _b, _c = _a.dateKey, dateKey = _c === void 0 ? 'date' : _c, _d = _a.commentKey, commentKey = _d === void 0 ? 'comment' : _d, _e = _a.imgSrcKey, imgSrcKey = _e === void 0 ? 'imgSrc' : _e, containerClassName = _a.containerClassName, containerStyle = _a.containerStyle, cardClassName = _a.cardClassName, cardStyle = _a.cardStyle, headerClassName = _a.headerClassName, headerStyle = _a.headerStyle, imgClassName = _a.imgClassName, imgStyle = _a.imgStyle, infoClassName = _a.infoClassName, infoStyle = _a.infoStyle, nameClassName = _a.nameClassName, nameStyle = _a.nameStyle, dateClassName = _a.dateClassName, dateStyle = _a.dateStyle, bodyClassName = _a.bodyClassName, bodyStyle = _a.bodyStyle, commentClassName = _a.commentClassName, commentStyle = _a.commentStyle, renderItem = _a.renderItem // Custom render function
@@ -16,13 +16,13 @@ export var ShowMessageCard = function (_a) {
16
16
  // Use custom render function if provided
17
17
  return (React.createElement(React.Fragment, { key: item.id || index }, renderItem(item)));
18
18
  }
19
- var _a = useState(false), showInitials = _a[0], setShowInitials = _a[1];
20
- var handleImageError = function () {
21
- setShowInitials(true);
22
- };
19
+ // const [showInitials, setShowInitials] = useState(false);
20
+ // const handleImageError = () => {
21
+ // setShowInitials(true);
22
+ // };
23
23
  return (React.createElement("div", { key: item.id || index, className: "message-card ".concat(cardClassName || ''), style: cardStyle },
24
24
  React.createElement("div", { className: "message-card-header ".concat(headerClassName || ''), style: headerStyle },
25
- showInitials || !item[imgSrcKey] ? (React.createElement("div", { className: "message-card-initials ".concat(imgClassName || ''), style: imgStyle }, getInitials(item[nameKey]))) : (React.createElement("img", { src: item[imgSrcKey], alt: item[nameKey], className: "message-card-img ".concat(imgClassName || ''), style: imgStyle, onError: handleImageError })),
25
+ !item[imgSrcKey] ? (React.createElement("div", { className: "message-card-initials ".concat(imgClassName || ''), style: imgStyle }, getInitials(item[nameKey]))) : (React.createElement("img", { src: item[imgSrcKey], alt: item[nameKey], className: "message-card-img ".concat(imgClassName || ''), style: imgStyle })),
26
26
  React.createElement("div", { className: "message-card-info ".concat(infoClassName || ''), style: infoStyle },
27
27
  React.createElement("h3", { className: "message-card-name ".concat(nameClassName || ''), style: nameStyle }, item[nameKey]),
28
28
  React.createElement("p", { className: "message-card-date ".concat(dateClassName || ''), style: dateStyle }, item[dateKey]))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-mention-input",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -79,11 +79,11 @@ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
79
79
  );
80
80
  }
81
81
 
82
- const [showInitials, setShowInitials] = useState(false);
82
+ // const [showInitials, setShowInitials] = useState(false);
83
83
 
84
- const handleImageError = () => {
85
- setShowInitials(true);
86
- };
84
+ // const handleImageError = () => {
85
+ // setShowInitials(true);
86
+ // };
87
87
 
88
88
  return (
89
89
  <div
@@ -95,7 +95,8 @@ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
95
95
  className={`message-card-header ${headerClassName || ''}`}
96
96
  style={headerStyle}
97
97
  >
98
- {showInitials || !item[imgSrcKey] ? (
98
+ {/* {showInitials || !item[imgSrcKey] ? ( */}
99
+ { !item[imgSrcKey] ? (
99
100
  <div
100
101
  className={`message-card-initials ${imgClassName || ''}`}
101
102
  style={imgStyle}
@@ -108,7 +109,7 @@ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
108
109
  alt={item[nameKey]}
109
110
  className={`message-card-img ${imgClassName || ''}`}
110
111
  style={imgStyle}
111
- onError={handleImageError}
112
+ // onError={handleImageError}
112
113
  />
113
114
  )}
114
115
  <div