ForwardContainer

master
Tudor Stanciu 2021-05-16 00:51:14 +03:00
parent 1e17dc47de
commit 64e2771d06
5 changed files with 73 additions and 1 deletions

View File

@ -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 }) {
<Route path="/about" component={AboutContainer} />
<Route path="/sessions" component={SessionContainer} />
<Route path="/release-notes" component={ReleaseNotesContainer} />
<Route
path="/forwards/:forwardId([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})"
component={ForwardContainer}
/>
<Route component={PageNotFound} />
</Switch>
<ToastNotifier />

View File

@ -0,0 +1,8 @@
import React from "react";
import PropTypes from "prop-types";
const ForwardComponent = () => {
return <div>in dev</div>;
};
export default ForwardComponent;

View File

@ -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 <ForwardComponent />;
};
ForwardContainer.propTypes = {};
export default ForwardContainer;

View File

@ -0,0 +1,8 @@
import React from "react";
import PropTypes from "prop-types";
const ForwardOptionsAdvancedComponent = () => {
return <div>in dev</div>;
};
export default ForwardOptionsAdvancedComponent;

View File

@ -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 <ForwardOptionsAdvancedComponent />;
};
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);