From 556e12c964fcac8bd6a558aa8d9bcf76ef5b7c0f Mon Sep 17 00:00:00 2001 From: Maciej Lenartowicz Date: Fri, 17 Jan 2020 12:44:11 +0100 Subject: [PATCH] Revert "Prompt as an optional element of ForisForm." This reverts commit 75bfbb88ae5582349b6f7a5627d814aaf2a12a31. --- src/common/WiFiSettings/WiFiSettings.js | 4 +--- src/form/components/ForisForm.js | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/common/WiFiSettings/WiFiSettings.js b/src/common/WiFiSettings/WiFiSettings.js index ef68e26..ded5214 100644 --- a/src/common/WiFiSettings/WiFiSettings.js +++ b/src/common/WiFiSettings/WiFiSettings.js @@ -17,11 +17,10 @@ WiFiSettings.propTypes = { endpoint: PropTypes.string.isRequired, resetEndpoint: PropTypes.string.isRequired, hasGuestNetwork: PropTypes.bool, - hasPrompt: PropTypes.bool, }; export function WiFiSettings({ - ws, endpoint, resetEndpoint, hasGuestNetwork, hasPrompt, + ws, endpoint, resetEndpoint, hasGuestNetwork, }) { return ( <> @@ -34,7 +33,6 @@ export function WiFiSettings({ prepData={prepData} prepDataToSubmit={prepDataToSubmit} validator={validator} - hasPrompt={hasPrompt} > diff --git a/src/form/components/ForisForm.js b/src/form/components/ForisForm.js index 2c86f9a..c09edc5 100644 --- a/src/form/components/ForisForm.js +++ b/src/form/components/ForisForm.js @@ -48,8 +48,6 @@ ForisForm.propTypes = { validator: PropTypes.func.isRequired, /** Disables form */ disabled: PropTypes.bool, - /** If true user will be prompted before leaving the page containing form. */ - hasPrompt: PropTypes.bool, /** reForis form components. */ children: PropTypes.node.isRequired, /** Optional override of form submit callback */ @@ -73,7 +71,6 @@ ForisForm.defaultProps = { postCallback: () => undefined, validator: () => undefined, disabled: false, - hasPrompt: true, }; /** Serves as HOC for all foris forms components. */ @@ -85,7 +82,6 @@ export function ForisForm({ postCallback, validator, disabled, - hasPrompt, onSubmitOverridden, children, }) { @@ -160,7 +156,7 @@ export function ForisForm({ return (
- {hasPrompt && } +
{childrenWithFormProps}