BOD-36 #comment Issue encountered when changing loading status from parent container in App.Container.jsx. No issues when changing status from another component.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
startLoading,
|
||||
endLoading
|
||||
} from "../../redux/application/application.actions";
|
||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
||||
import T, {
|
||||
Subject
|
||||
@@ -11,31 +15,37 @@ const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
setEmailOptions: e => dispatch(setEmailOptions(e))
|
||||
setEmailOptions: e => dispatch(setEmailOptions(e)),
|
||||
load: () => dispatch(startLoading()),
|
||||
endload: () => dispatch(endLoading())
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(function Test({ setEmailOptions }) {
|
||||
)(function Test({ setEmailOptions, load, endload }) {
|
||||
return (
|
||||
<button
|
||||
onClick={() =>
|
||||
setEmailOptions({
|
||||
messageOptions: {
|
||||
from: { name: "Kavia Autobody", address: "noreply@bodyshop.app" },
|
||||
to: "patrickwf@gmail.com",
|
||||
replyTo: "snaptsoft@gmail.com",
|
||||
subject: Subject
|
||||
},
|
||||
template: T,
|
||||
queryConfig: [
|
||||
EMAIL_APPOINTMENT_CONFIRMATION,
|
||||
{ variables: { id: "91bb31dd-ea87-4cfc-bbe2-2ec754dcb861" } }
|
||||
]
|
||||
})
|
||||
}
|
||||
>
|
||||
Set email config.
|
||||
</button>
|
||||
<div>
|
||||
<button
|
||||
onClick={() =>
|
||||
setEmailOptions({
|
||||
messageOptions: {
|
||||
from: { name: "Kavia Autobody", address: "noreply@bodyshop.app" },
|
||||
to: "patrickwf@gmail.com",
|
||||
replyTo: "snaptsoft@gmail.com",
|
||||
subject: Subject
|
||||
},
|
||||
template: T,
|
||||
queryConfig: [
|
||||
EMAIL_APPOINTMENT_CONFIRMATION,
|
||||
{ variables: { id: "91bb31dd-ea87-4cfc-bbe2-2ec754dcb861" } }
|
||||
]
|
||||
})
|
||||
}
|
||||
>
|
||||
Set email config.
|
||||
</button>
|
||||
<button onClick={() => load()}>Load</button>
|
||||
<button onClick={() => endload()}>Stop</button>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user