umwd-components 0.1.669 → 0.1.670
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.
- package/dist/src/components/e-commerce/enduser/EnduserProfileDisplay.js +1 -1
- package/dist/src/components/e-commerce/enduser/EnduserProfileEditForm.js +1 -1
- package/dist/src/data/services/e-commerce/enduser/get-enduser-me-loader.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/types/e-commerce/enduser/types.d.ts +0 -4
- package/package.json +1 -1
- package/src/components/e-commerce/enduser/EnduserProfileDisplay.tsx +0 -18
- package/src/components/e-commerce/enduser/EnduserProfileEditForm.tsx +1 -37
- package/src/data/services/e-commerce/enduser/get-enduser-me-loader.ts +1 -11
- package/src/types/e-commerce/enduser/types.ts +0 -2
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import e from"react";import t from"@mui/material/Paper";import r from"@mui/material/Stack";import a from"@mui/material/Typography";import n from"@mui/material/Button";import i from"@mui/material/Divider";import m from"@mui/material/Grid";import o from"@mui/material/Alert";import l from"@mui/icons-material/Person";import c from"@mui/icons-material/Email";import f from"@mui/icons-material/Phone";import{StyledLink as s}from"../../StyledLink.js";import{usePathname as u}from"next/navigation";function p(p){var E=p.data,d=E.first_name,g=E.last_name,h=E.email,v=E.phone,y=E.editProfileUrl,x=void 0===y?"/dashboard/admin/user/profile/edit":y,w=E.completeEnough,P=void 0!==w&&w,I=u().includes("admin/user/");return e.createElement(t,{sx:{p:2}},e.createElement(r,{spacing:2},I&&e.createElement(e.Fragment,null,Boolean(P)?e.createElement(r,{direction:"row",justifyContent:"flex-end"},e.createElement(s,{href:x,target:"_self"},e.createElement(n,{variant:"contained"},"edit profile"))):e.createElement(o,{severity:"warning",action:e.createElement(s,{href:x,target:"_self"},e.createElement(n,{variant:"contained"},"complete profile"))},"After completion of your profile you can enjoy all the benefits of your services.")),e.createElement(i,null),e.createElement(m,{container:!0,spacing:2,sx:{width:"100%"}},e.createElement(m,{item:!0,xs:12,md:4},e.createElement(a,{variant:"h6"},"Personal Information"),e.createElement(r,{spacing:1,sx:{mt:2}},e.createElement(r,{direction:"row",alignItems:"center"},e.createElement(l,null),e.createElement(a,null,"".concat(d," ").concat(g))),e.createElement(r,{direction:"row",alignItems:"center"},e.createElement(c,null),e.createElement(a,null,h)),e.createElement(r,{direction:"row",alignItems:"center"},e.createElement(f,null),e.createElement(a,null,v)))))))}export{p as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Box";import a from"@mui/material/Stack";import n from"@mui/material/Grid";import i from"@mui/material/TextField";import m from"@mui/material/Typography";import o from"@mui/material/Button";import{SubmitButton as l}from"../../SubmitButton.js";import{useFormState as s}from"react-dom";import{updateEnduserProfileAction as c}from"../../../data/actions/e-commerce/enduser/profile-actions.js";import{useSession as u}from"../../../context/auth/SessionContext.js";import{useSnackbar as p}from"../../../context/common/SnackbarContext.js";import d,{useEffect as f}from"react";import E from"@mui/icons-material/Email";import g from"@mui/icons-material/Phone";import v from"@mui/icons-material/Person";var x={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function h(h){var y=h.data,b=h.sx,C=h.revalidateCallback,S=h.handleClose,j=y.id,I=y.first_name,w=y.last_name,P=y.email,k=y.phone,A=c.bind(null,parseInt(j)),B=e(s(A,x),2),T=B[0],_=B[1],V=p().handleAddMessage,z=u().refreshSession;return f((function(){(null==T?void 0:T.message)&&(V({message:T.message,severity:T.severity||"error"}),"success"===T.severity&&(z(),C&&C(),S&&S()))}),[null==T?void 0:T.message]),f((function(){(null==T?void 0:T.strapiErrors)&&V({message:T.strapiErrors.message||"Error performing action",severity:"error"})}),[null==T?void 0:T.strapiErrors]),d.createElement(r,{sx:t([],e(Array.isArray(b)?b:[b]),!1)},d.createElement("form",{action:_},d.createElement(n,{container:!0,spacing:2},d.createElement(n,{item:!0,xs:12},d.createElement(a,{spacing:2},d.createElement(m,{variant:"h3",component:"h1"},"Edit Profile"),d.createElement(m,{variant:"body1"},"Update your profile information"))),d.createElement(n,{item:!0,xs:12},d.createElement(a,{spacing:2},d.createElement(m,{variant:"h6"},"Personal Information"),d.createElement(a,{direction:"row",alignItems:"center"},d.createElement(v,null),d.createElement(m,null,"".concat(I," ").concat(w))),d.createElement(a,{direction:"row",alignItems:"center"},d.createElement(E,null),d.createElement(i,{id:"email",name:"email",label:"Email",type:"email",defaultValue:P})),d.createElement(a,{direction:"row",alignItems:"center"},d.createElement(g,null),d.createElement(i,{id:"phone",name:"phone",label:"Phone",type:"tel",defaultValue:k})))),d.createElement(n,{item:!0,xs:12},d.createElement(a,{direction:"row",justifyContent:"space-between",spacing:2,alignItems:"center",sx:{mt:2}},S&&d.createElement(o,{onClick:S,variant:"outlined"},"Cancel"),d.createElement(l,{text:"Save Changes",loadingText:"Saving...",variant:"contained"}))))))}export{h as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__awaiter as
|
|
7
|
+
import{__awaiter as r,__generator as e}from"../../../../../node_modules/tslib/tslib.es6.js";import{getAuthToken as t}from"../../get-token.js";import o from"../../../../../node_modules/qs/lib/index.js";import{getStrapiURL as n}from"../../../../lib/utils.js";import{unstable_noStore as s}from"next/cache";var a=n(),i=o.stringify({populate:{enduser_profile:!0}});function u(){return r(this,void 0,void 0,(function(){var r,o,n,u,l;return e(this,(function(e){switch(e.label){case 0:return s(),(r=new URL("/api/users/me",a)).search=i,[4,t()];case 1:if(!(o=e.sent()))return[2,{ok:!1,data:null,error:null}];e.label=2;case 2:return e.trys.push([2,5,,6]),[4,fetch(r.href,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)},cache:"no-cache"})];case 3:if(!(n=e.sent()).ok)throw new Error("HTTP error! status: ".concat(n.status));return[4,n.json()];case 4:return(u=e.sent()).error?[2,{ok:!1,data:null,error:u.error}]:[2,{ok:!0,data:u,error:null}];case 5:return l=e.sent(),console.error("getExtendedEnduserMeLoader Error:",l),[2,{ok:!1,data:null,error:l}];case 6:return[2]}}))}))}o.stringify({populate:"role"});export{u as getExtendedEnduserMeLoader};
|