@visns-studio/visns-components 5.2.12 → 5.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -78,7 +78,7 @@
78
78
  "react-dom": "^17.0.0 || ^18.0.0"
79
79
  },
80
80
  "name": "@visns-studio/visns-components",
81
- "version": "5.2.12",
81
+ "version": "5.2.13",
82
82
  "description": "Various packages to assist in the development of our Custom Applications.",
83
83
  "main": "src/index.js",
84
84
  "files": [
@@ -19,7 +19,7 @@ import styles from './styles/GenericDashboard.module.scss';
19
19
 
20
20
  const toSnakeCase = (str) => str.replace(/[\s-]+/g, '_').toLowerCase();
21
21
 
22
- function GenericDashboard({ setting, userProfile }) {
22
+ function GenericDashboard({ setting, userProfile, dynamicDashboard = false }) {
23
23
  const swapy = useRef(null);
24
24
  const container = useRef(null);
25
25
  const navigate = useNavigate();
@@ -1038,25 +1038,27 @@ function GenericDashboard({ setting, userProfile }) {
1038
1038
 
1039
1039
  return (
1040
1040
  <>
1041
- <div className={styles.editButtonContainer}>
1042
- {editMode && (
1043
- <>
1044
- <button
1045
- className={styles.btn}
1046
- style={{ marginRight: '10px' }}
1047
- onClick={() => setShowAddWidgetModal(true)}
1048
- >
1049
- Add Widget
1050
- </button>
1051
- </>
1052
- )}
1053
- <button
1054
- className={styles.btn}
1055
- onClick={() => setEditMode((prev) => !prev)}
1056
- >
1057
- {editMode ? 'Done' : 'Edit Dashboard'}
1058
- </button>
1059
- </div>
1041
+ {dynamicDashboard && (
1042
+ <div className={styles.editButtonContainer}>
1043
+ {editMode && (
1044
+ <>
1045
+ <button
1046
+ className={styles.btn}
1047
+ style={{ marginRight: '10px' }}
1048
+ onClick={() => setShowAddWidgetModal(true)}
1049
+ >
1050
+ Add Widget
1051
+ </button>
1052
+ </>
1053
+ )}
1054
+ <button
1055
+ className={styles.btn}
1056
+ onClick={() => setEditMode((prev) => !prev)}
1057
+ >
1058
+ {editMode ? 'Done' : 'Edit Dashboard'}
1059
+ </button>
1060
+ </div>
1061
+ )}
1060
1062
  <div className={styles.grid} ref={container}>
1061
1063
  {renderWidgets()}
1062
1064
  <Popup open={modalShow} onClose={closeModal}>