From 64e2771d061dbcd53175449d24c8124db47f0cc4 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sun, 16 May 2021 00:51:14 +0300 Subject: [PATCH] ForwardContainer --- src/components/App.js | 5 +++ .../core/components/ForwardComponent.js | 8 ++++ .../core/components/ForwardContainer.js | 16 ++++++++ .../ForwardOptionsAdvancedComponent.js | 8 ++++ .../advanced/ForwardOptionsAdvancedView.js | 37 ++++++++++++++++++- 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/features/forwards/core/components/ForwardComponent.js create mode 100644 src/features/forwards/core/components/ForwardContainer.js create mode 100644 src/features/forwards/options/components/advanced/ForwardOptionsAdvancedComponent.js diff --git a/src/components/App.js b/src/components/App.js index 74f73a1..d8d7c1d 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -12,6 +12,7 @@ import { bindActionCreators } from "redux"; import { loadFrontendSession } from "../features/frontendSession/actionCreators"; import ToastNotifier from "../features/snackbar/components/ToastNotifier"; import BotsManager from "../features/chatbot/components/BotsManager"; +import ForwardContainer from "../features/forwards/core/components/ForwardContainer"; function App({ actions }) { useEffect(() => { @@ -34,6 +35,10 @@ function App({ actions }) { + diff --git a/src/features/forwards/core/components/ForwardComponent.js b/src/features/forwards/core/components/ForwardComponent.js new file mode 100644 index 0000000..5a148ea --- /dev/null +++ b/src/features/forwards/core/components/ForwardComponent.js @@ -0,0 +1,8 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const ForwardComponent = () => { + return
in dev
; +}; + +export default ForwardComponent; diff --git a/src/features/forwards/core/components/ForwardContainer.js b/src/features/forwards/core/components/ForwardContainer.js new file mode 100644 index 0000000..bb7a454 --- /dev/null +++ b/src/features/forwards/core/components/ForwardContainer.js @@ -0,0 +1,16 @@ +import React from "react"; +//import PropTypes from "prop-types"; +import ForwardComponent from "./ForwardComponent"; +import { useParams } from "react-router"; + +const ForwardContainer = () => { + const params = useParams(); + const forwardId = params.forwardId; + alert(forwardId); + + return ; +}; + +ForwardContainer.propTypes = {}; + +export default ForwardContainer; diff --git a/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedComponent.js b/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedComponent.js new file mode 100644 index 0000000..5461d2c --- /dev/null +++ b/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedComponent.js @@ -0,0 +1,8 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const ForwardOptionsAdvancedComponent = () => { + return
in dev
; +}; + +export default ForwardOptionsAdvancedComponent; diff --git a/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedView.js b/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedView.js index 2709b68..ab0c8e8 100644 --- a/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedView.js +++ b/src/features/forwards/options/components/advanced/ForwardOptionsAdvancedView.js @@ -1 +1,36 @@ -//ForwardOptions +import React, { useEffect } from "react"; +import { connect } from "react-redux"; +import { bindActionCreators } from "redux"; +import PropTypes from "prop-types"; +import { loadForwardOptions } from "../../actionCreators"; +import ForwardOptionsAdvancedComponent from "./ForwardOptionsAdvancedComponent"; + +const ForwardOptionsAdvancedView = ({ actions, options }) => { + useEffect(() => { + // actions.loadForwardOptions(forward.optionId); + }, []); + + return ; +}; + +ForwardOptionsAdvancedView.propTypes = { + actions: PropTypes.object.isRequired, + options: PropTypes.object.isRequired +}; + +function mapStateToProps(state) { + return { + options: state.options + }; +} + +function mapDispatchToProps(dispatch) { + return { + actions: bindActionCreators({ loadForwardOptions }, dispatch) + }; +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(ForwardOptionsAdvancedView);