Просмотр исходного кода

add fix for expandable resource button

Alexander Belanger 4 лет назад
Родитель
Сommit
fd73a9e2ec
1 измененных файлов с 10 добавлено и 8 удалено
  1. 10 8
      dashboard/src/components/ExpandableResource.tsx

+ 10 - 8
dashboard/src/components/ExpandableResource.tsx

@@ -76,14 +76,16 @@ const ExpandableResource: React.FC<Props> = (props) => {
             </Pair>
           );
         })}
-        <StyledSaveButton
-          onClick={onSave}
-          clearPosition={true}
-          text={button.name}
-          helper={button.description}
-          statusPosition={"right"}
-          className="expanded-save-button"
-        />
+        {button && (
+          <StyledSaveButton
+            onClick={onSave}
+            clearPosition={true}
+            text={button.name}
+            helper={button.description}
+            statusPosition={"right"}
+            className="expanded-save-button"
+          />
+        )}
       </ExpandedWrapper>
     </ResourceTab>
   );