Added log rocket + analytics to ensure functionality

This commit is contained in:
Patrick Fic
2020-10-22 12:38:33 -07:00
parent 295b51267b
commit ad7cbb308b
26 changed files with 434 additions and 134 deletions

View File

@@ -4,10 +4,11 @@ import React, { useEffect, useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { QUERY_BODYSHOP, UPDATE_SHOP } from "../../../graphql/bodyshop.queries";
import ipcTypes from "../../../ipc.types";
import { setBodyshop } from "../../../redux/user/user.actions";
import ErrorResultAtom from "../../atoms/error-result/error-result.atom";
import ShopSettingsFormMolecule from "../../molecules/shop-settings-form/shop-settings-form.molecule";
const { ipcRenderer } = window;
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
});
@@ -15,10 +16,6 @@ const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
setBodyshop: (shop) => dispatch(setBodyshop(shop)),
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(ShopSettingsOrganism);
export function ShopSettingsOrganism({ setBodyshop }) {
const { loading, error, data } = useQuery(QUERY_BODYSHOP);
@@ -32,6 +29,9 @@ export function ShopSettingsOrganism({ setBodyshop }) {
const handleFinish = async (values) => {
setSaveLoading(true);
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
event: "UPDATE_SHOP_DETAILS",
});
const result = await updateBodyshop({
variables: { id: data.bodyshops[0].id, shop: values },
@@ -70,3 +70,8 @@ export function ShopSettingsOrganism({ setBodyshop }) {
</div>
);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(ShopSettingsOrganism);