diff --git a/client/src/actions/auth.js b/client/src/actions/auth.js
index 0914ff69..1cd468bb 100644
--- a/client/src/actions/auth.js
+++ b/client/src/actions/auth.js
@@ -2,14 +2,14 @@ import * as api from '../api/index'
import { AUTH, CREATE_PROFILE } from './constants'
-export const signin =(formData, openSnackbar) => async(dispatch) => {
+export const signin =(formData, openSnackbar, setLoading) => async(dispatch) => {
try {
//login the user
const { data } = await api.signIn(formData)
dispatch({ type: AUTH, data})
-
+ // setLoading(false)
openSnackbar("Signin successfull")
// history.push('/dashboard')
window.location.href="/dashboard"
@@ -17,10 +17,11 @@ export const signin =(formData, openSnackbar) => async(dispatch) => {
} catch (error) {
// console.log(error?.response?.data?.message)
openSnackbar(error?.response?.data?.message)
+ setLoading(false)
}
}
-export const signup =(formData, openSnackbar) => async(dispatch) => {
+export const signup =(formData, openSnackbar, setLoading) => async(dispatch) => {
try {
//Sign up the user
@@ -35,6 +36,7 @@ export const signup =(formData, openSnackbar) => async(dispatch) => {
} catch (error) {
console.log(error)
openSnackbar(error?.response?.data?.message)
+ setLoading(false)
}
}
diff --git a/client/src/components/Invoice/Invoice.js b/client/src/components/Invoice/Invoice.js
index 0dad1879..1c918e05 100644
--- a/client/src/components/Invoice/Invoice.js
+++ b/client/src/components/Invoice/Invoice.js
@@ -37,6 +37,7 @@ import AddClient from './AddClient';
import InvoiceType from './InvoiceType';
import axios from 'axios'
import { useLocation } from 'react-router-dom'
+import { getProfilesByUser } from '../../actions/profile'
// import SelectType from './SelectType'
const useStyles = makeStyles((theme) => ({
@@ -82,13 +83,18 @@ const Invoice = () => {
const dispatch = useDispatch()
const history = useHistory()
const user = JSON.parse(localStorage.getItem('profile'))
+ const { profiles } = useSelector((state) => state.profiles)
+
useEffect(() => {
getTotalCount()
+ dispatch(getProfilesByUser({ search: user?.result?._id || user?.result.googleId}))
+ // setInvoiceData({...invoiceData, notes: profiles?.paymentDetails})
// eslint-disable-next-line
},[location])
+console.log(profiles.paymentDetails)
const getTotalCount = async() => {
try {
@@ -155,7 +161,7 @@ const Invoice = () => {
setInvoiceData((prevState) => ({...prevState, tax: e.target.value}))
}
- // console.log(invoiceData)
+ console.log(invoiceData)
// Change handler for dynamically added input field
const handleChange =(index, e) => {
const values = [...invoiceData.items]
@@ -472,11 +478,12 @@ const Invoice = () => {
-
Notes/Terms
+ Note/Payment Details
diff --git a/client/src/components/InvoiceDetails/InvoiceDetails.js b/client/src/components/InvoiceDetails/InvoiceDetails.js
index 6c2ca676..2aa6c71f 100644
--- a/client/src/components/InvoiceDetails/InvoiceDetails.js
+++ b/client/src/components/InvoiceDetails/InvoiceDetails.js
@@ -362,8 +362,8 @@ if(!invoice) {
-
Notes/Terms
-
{invoiceData.notes}
+
Note/Payment Details
+
{invoiceData.notes}
{/* */}
diff --git a/client/src/components/InvoiceDetails/InvoiceDetails.module.css b/client/src/components/InvoiceDetails/InvoiceDetails.module.css
index d78c1b92..e11d9bff 100644
--- a/client/src/components/InvoiceDetails/InvoiceDetails.module.css
+++ b/client/src/components/InvoiceDetails/InvoiceDetails.module.css
@@ -311,13 +311,12 @@ input::-webkit-inner-spin-button {
text-align: left;
}
.note {
- margin-top: 20px;
-}
-
-.note h4 {
+ margin: 50px 20px;
text-align: left;
+ border-top: solid 1px #b7b7b7;
}
+
.toolBar {
display: flex;
}
diff --git a/client/src/components/Login/Google.js b/client/src/components/Login/Google.js
index 97ab1bad..89e019ad 100644
--- a/client/src/components/Login/Google.js
+++ b/client/src/components/Login/Google.js
@@ -2,7 +2,7 @@ import React from "react";
function Google() {
return (
-