From 3e4a036cb0504db5271360c484a7f446c4728eba Mon Sep 17 00:00:00 2001 From: mushka Date: Fri, 19 Aug 2022 04:09:00 +0300 Subject: [PATCH] permanent settings update and tweak --- .../sub-components/PermanentSettings/index.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js index 998df6e4e0..45b20f1fcc 100644 --- a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js +++ b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js @@ -10,7 +10,7 @@ import { import PermanentSetting from "./PermanentSetting"; const StyledPermanentSettings = styled.div` - display: flex; + display: ${(props) => (props.displayNone ? "none" : "flex")}; flex-direction: row; gap: 8px; margin-top: -12px; @@ -23,16 +23,6 @@ const PermanentSettings = ({ storageLocation, isPrivate, }) => { - const thirdpartyTitle = isThirdparty - ? getProviderTypeTitle(storageLocation.providerKey, t) - : ""; - - const thirdpartyIcon = isThirdparty - ? getProviderTypeIcon(storageLocation.providerKey) - : ""; - - const thirdpartyFolderName = isThirdparty ? storageLocation.title : ""; - const createThirdpartyPath = () => { const path = storageLocation.parentId.split("|"); path.shift(); @@ -41,10 +31,13 @@ const PermanentSettings = ({ return `(${path.join("/")})`; }; + const thirdpartyTitle = getProviderTypeTitle(storageLocation?.providerKey, t); + const thirdpartyIcon = getProviderTypeIcon(storageLocation?.providerKey); + const thirdpartyFolderName = isThirdparty ? storageLocation?.title : ""; const thirdpartyPath = isThirdparty ? createThirdpartyPath() : ""; return ( - + {isThirdparty && (