From 0b69a51482d1f18061eb88a4ce66728aa06b346d Mon Sep 17 00:00:00 2001 From: William Wong Date: Thu, 6 Feb 2020 00:32:58 -0800 Subject: [PATCH] Apply PR comments --- .../src/Attachment/FileAttachment.js | 11 +------ .../component/src/Attachment/FileContent.js | 29 ++++++++----------- .../src/Styles/StyleSet/FileAttachment.js | 3 -- .../component/src/Styles/createStyleSet.js | 2 -- 4 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 packages/component/src/Styles/StyleSet/FileAttachment.js diff --git a/packages/component/src/Attachment/FileAttachment.js b/packages/component/src/Attachment/FileAttachment.js index 61dc38bee5..7fa45cadda 100644 --- a/packages/component/src/Attachment/FileAttachment.js +++ b/packages/component/src/Attachment/FileAttachment.js @@ -2,24 +2,15 @@ import PropTypes from 'prop-types'; import React from 'react'; import FileContent from './FileContent'; -import useStyleSet from '../hooks/useStyleSet'; const FileAttachment = ({ activity: { attachments = [], channelData: { attachmentSizes = [] } = {} } = {}, attachment }) => { - const [{ fileAttachment: fileAttachmentStyleSet }] = useStyleSet(); const attachmentIndex = attachments.indexOf(attachment); const size = attachmentSizes[attachmentIndex]; - return ( - - ); + return ; }; FileAttachment.propTypes = { diff --git a/packages/component/src/Attachment/FileContent.js b/packages/component/src/Attachment/FileContent.js index 0c7daeada5..bfcaae7f3e 100644 --- a/packages/component/src/Attachment/FileContent.js +++ b/packages/component/src/Attachment/FileContent.js @@ -66,25 +66,20 @@ const FileContent = ({ className, href, fileName, size }) => { aria-hidden={true} className={classNames('webchat__fileContent', ROOT_CSS + '', fileContentStyleSet + '', (className || '') + '')} > + {href ? ( - - - - {/* Although nested, Chrome v75 does not respect the above aria-hidden and makes the below aria-hidden in FileContentBadge necessary */} - - - + + {/* Although nested, Chrome v75 does not respect the above aria-hidden and makes the below aria-hidden in FileContentBadge necessary */} + + ) : ( - - - - + )} ); diff --git a/packages/component/src/Styles/StyleSet/FileAttachment.js b/packages/component/src/Styles/StyleSet/FileAttachment.js deleted file mode 100644 index 7b84930165..0000000000 --- a/packages/component/src/Styles/StyleSet/FileAttachment.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function createFileAttachmentStyle() { - return {}; -} diff --git a/packages/component/src/Styles/createStyleSet.js b/packages/component/src/Styles/createStyleSet.js index 79a794d342..f86b2f0a53 100644 --- a/packages/component/src/Styles/createStyleSet.js +++ b/packages/component/src/Styles/createStyleSet.js @@ -11,7 +11,6 @@ import createConnectivityNotification from './StyleSet/ConnectivityNotification' import createDictationInterimsStyle from './StyleSet/DictationInterims'; import createErrorBoxStyle from './StyleSet/ErrorBox'; import createErrorNotificationStyle from './StyleSet/ErrorNotification'; -import createFileAttachmentStyle from './StyleSet/FileAttachment'; import createFileContentStyle from './StyleSet/FileContent'; import createMicrophoneButtonStyle from './StyleSet/MicrophoneButton'; import createRootStyle from './StyleSet/Root'; @@ -181,7 +180,6 @@ export default function createStyleSet(options) { dictationInterims: createDictationInterimsStyle(options), errorBox: createErrorBoxStyle(options), errorNotification: createErrorNotificationStyle(options), - fileAttachment: createFileAttachmentStyle(options), fileContent: createFileContentStyle(options), microphoneButton: createMicrophoneButtonStyle(options), options: {