@performant-software/semantic-components 1.0.19-beta.2 → 1.0.19-beta.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/semantic-components",
3
- "version": "1.0.19-beta.2",
3
+ "version": "1.0.19-beta.3",
4
4
  "description": "A package of shared components based on the Semantic UI Framework.",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",
@@ -12,7 +12,7 @@
12
12
  "build": "webpack --mode production && flow-copy-source -v src types"
13
13
  },
14
14
  "dependencies": {
15
- "@performant-software/shared-components": "^1.0.19-beta.2",
15
+ "@performant-software/shared-components": "^1.0.19-beta.3",
16
16
  "@react-google-maps/api": "^2.8.1",
17
17
  "axios": "^0.26.1",
18
18
  "i18next": "^19.4.4",
@@ -35,6 +35,11 @@ type Props = EditContainerProps & {
35
35
  */
36
36
  defaultTab?: string,
37
37
 
38
+ /**
39
+ * If `false`, the save button will be hidden.
40
+ */
41
+ editable?: boolean,
42
+
38
43
  /**
39
44
  * Props to provide to the Semantic UI `Menu` component.
40
45
  */
@@ -131,12 +136,14 @@ const SimpleEditPage: any = (props: Props) => {
131
136
  <Menu.Item
132
137
  className='button-container'
133
138
  >
134
- <Button
135
- content={i18n.t('Common.buttons.save')}
136
- disabled={props.loading || props.saving}
137
- onClick={props.onSave}
138
- primary
139
- />
139
+ { props.editable && (
140
+ <Button
141
+ content={i18n.t('Common.buttons.save')}
142
+ disabled={props.loading || props.saving}
143
+ onClick={props.onSave}
144
+ primary
145
+ />
146
+ )}
140
147
  <Button
141
148
  basic
142
149
  content={i18n.t('Common.buttons.cancel')}
@@ -231,6 +238,7 @@ const SimpleEditPage: any = (props: Props) => {
231
238
  };
232
239
 
233
240
  SimpleEditPage.defaultProps = {
241
+ editable: true,
234
242
  menuProps: {
235
243
  pointing: true,
236
244
  secondary: true
@@ -35,6 +35,11 @@ type Props = EditContainerProps & {
35
35
  */
36
36
  defaultTab?: string,
37
37
 
38
+ /**
39
+ * If `false`, the save button will be hidden.
40
+ */
41
+ editable?: boolean,
42
+
38
43
  /**
39
44
  * Props to provide to the Semantic UI `Menu` component.
40
45
  */
@@ -131,12 +136,14 @@ const SimpleEditPage: any = (props: Props) => {
131
136
  <Menu.Item
132
137
  className='button-container'
133
138
  >
134
- <Button
135
- content={i18n.t('Common.buttons.save')}
136
- disabled={props.loading || props.saving}
137
- onClick={props.onSave}
138
- primary
139
- />
139
+ { props.editable && (
140
+ <Button
141
+ content={i18n.t('Common.buttons.save')}
142
+ disabled={props.loading || props.saving}
143
+ onClick={props.onSave}
144
+ primary
145
+ />
146
+ )}
140
147
  <Button
141
148
  basic
142
149
  content={i18n.t('Common.buttons.cancel')}
@@ -231,6 +238,7 @@ const SimpleEditPage: any = (props: Props) => {
231
238
  };
232
239
 
233
240
  SimpleEditPage.defaultProps = {
241
+ editable: true,
234
242
  menuProps: {
235
243
  pointing: true,
236
244
  secondary: true