فهرست منبع

fix: hide save button in readonly editor view (#1208)

Sukka 11 ماه پیش
والد
کامیت
4ab507fd43
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      src/components/profile/editor-viewer.tsx

+ 6 - 4
src/components/profile/editor-viewer.tsx

@@ -171,12 +171,14 @@ export const EditorViewer = (props: Props) => {
       </DialogContent>
 
       <DialogActions>
-        <Button onClick={onClose} variant="outlined">
+        <Button onClick={onClose} variant={readOnly ? "contained" : "outlined"}>
           {t("Cancel")}
         </Button>
-        <Button onClick={onSave} variant="contained">
-          {t("Save")}
-        </Button>
+        {readOnly ? null : (
+          <Button onClick={onSave} variant="contained">
+            {t("Save")}
+          </Button>
+        )}
       </DialogActions>
     </Dialog>
   );