@botonic/react 0.20.7 → 0.20.9
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.
package/package.json
CHANGED
package/src/components/image.jsx
CHANGED
|
@@ -26,7 +26,7 @@ export const Image = props => {
|
|
|
26
26
|
const closePreviewer = () => setIsPreviewerOpened(false)
|
|
27
27
|
|
|
28
28
|
const { getThemeProperty } = useContext(WebchatContext)
|
|
29
|
-
const
|
|
29
|
+
const ImagePreviewer = getThemeProperty(
|
|
30
30
|
WEBCHAT.CUSTOM_PROPERTIES.imagePreviewer,
|
|
31
31
|
null
|
|
32
32
|
)
|
|
@@ -36,15 +36,16 @@ export const Image = props => {
|
|
|
36
36
|
<StyledImage
|
|
37
37
|
src={props.src}
|
|
38
38
|
onClick={openPreviewer}
|
|
39
|
-
hasPreviewer={Boolean(
|
|
39
|
+
hasPreviewer={Boolean(ImagePreviewer)}
|
|
40
40
|
/>
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
src
|
|
44
|
-
isPreviewerOpened
|
|
45
|
-
openPreviewer
|
|
46
|
-
closePreviewer
|
|
47
|
-
|
|
41
|
+
{ImagePreviewer && (
|
|
42
|
+
<ImagePreviewer
|
|
43
|
+
src={props.src}
|
|
44
|
+
isPreviewerOpened={isPreviewerOpened}
|
|
45
|
+
openPreviewer={openPreviewer}
|
|
46
|
+
closePreviewer={closePreviewer}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
48
49
|
</>
|
|
49
50
|
)
|
|
50
51
|
}
|
|
@@ -313,7 +313,9 @@ export const Message = props => {
|
|
|
313
313
|
) : (
|
|
314
314
|
<BlobText blob={blob}>{textChildren}</BlobText>
|
|
315
315
|
)}
|
|
316
|
-
{buttons
|
|
316
|
+
{!!buttons.length && (
|
|
317
|
+
<div className='message-buttons-container'>{buttons}</div>
|
|
318
|
+
)}
|
|
317
319
|
{Boolean(blob) && hasBlobTick() && getBlobTick(6)}
|
|
318
320
|
{Boolean(blob) && hasBlobTick() && getBlobTick(5)}
|
|
319
321
|
</Blob>
|
|
@@ -52,8 +52,9 @@ const TimestampText = styled.div`
|
|
|
52
52
|
`
|
|
53
53
|
|
|
54
54
|
export const MessageTimestamp = ({ timestamp, style, isfromuser }) => {
|
|
55
|
+
const classSufix = isfromuser ? 'user' : 'bot'
|
|
55
56
|
return (
|
|
56
|
-
<TimestampContainer>
|
|
57
|
+
<TimestampContainer className={`botonic-timestamp-${classSufix}`}>
|
|
57
58
|
<TimestampText
|
|
58
59
|
isfromuser={isfromuser}
|
|
59
60
|
style={{
|