umwd-components 0.1.419 → 0.1.421
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as t,useEffect as o}from"react";import i from"@mui/material/Button";import m from"@mui/material/Paper";import
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as t,useEffect as o}from"react";import i from"@mui/material/Button";import m from"@mui/material/Paper";import l from"@mui/material/Stack";import a from"@mui/material/Box";import n from"@mui/material/CircularProgress";import{useSession as s}from"../../../context/auth/SessionContext.js";import{isCustomerProfileComplete as c}from"../../../lib/isCustomerProfileComplete.js";import u from"../customer/DenseCustomerProfileDisplay.js";import p from"../customer/CustomerProfileEditForm.js";function f(){var f=s(),d=f.user,E=f.loading,x=f.error,C=e(t((null==d?void 0:d.customer_profile)?d.customer_profile:null),2),g=C[0],h=C[1],v=e(t(!(g&&c(g))),2),j=v[0],P=v[1];return E||!d?r.createElement(a,{sx:{display:{xs:"none",md:"flex"},flexGrow:0,position:"relative",width:"40px",height:"40px"}},r.createElement(n,null)):x?r.createElement("p",null,"Error: ",x):(o((function(){console.log("user changed",d),h((null==d?void 0:d.customer_profile)?d.customer_profile:null)}),[d]),r.createElement(m,{sx:{p:2}},j?r.createElement(l,{spacing:2},r.createElement(p,{data:g}),r.createElement(i,{variant:"contained",onClick:function(){P(!1)},disabled:!c(g)},"cancel")):r.createElement(l,{spacing:2},r.createElement(u,{data:g}),r.createElement(i,{variant:"contained",onClick:function(){P(!0)}},"Change address"))))}export{f as default};
|