diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 6f0df6b98..181619f41 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -40334,6 +40334,268 @@ exports[`Storyshots Message Sequential thread messages following thread reply 1` `; +exports[`Storyshots Message Show a button as attachment 1`] = ` + + + + + + + + + + + + + + + + + + diego.mello + + + + 10:00 AM + + + + + Test Button + + + + Text button + + + + + + + + + +`; + exports[`Storyshots Message Static avatar 1`] = ` - Joker + Title - Some crazy texts + Image text diff --git a/app/containers/message/Attachments.js b/app/containers/message/Attachments.js index 0d068e9fd..0600e6d69 100644 --- a/app/containers/message/Attachments.js +++ b/app/containers/message/Attachments.js @@ -1,11 +1,35 @@ -import React from 'react'; +import React, { useContext } from 'react'; import { dequal } from 'dequal'; import PropTypes from 'prop-types'; +import { Text } from 'react-native'; import Image from './Image'; import Audio from './Audio'; import Video from './Video'; import Reply from './Reply'; +import Button from '../Button'; +import styles from './styles'; +import MessageContext from './Context'; + +const AttachedActions = ({ + attachment, theme +}) => { + const { onAnswerButtonPress } = useContext(MessageContext); + + const attachedButtons = attachment.actions.map((element) => { + if (element.type === 'button') { + return