Compare commits

...

5 Commits

Author SHA1 Message Date
victorAnumudu b418ca7d58 added aside menu back 2025-08-13 16:51:59 +01:00
ameye 9eea804f71 Merge branch 'profile-complete-layout' of MERMS/MermsPanelReactJS into master 2025-08-13 11:09:57 +00:00
victorAnumudu f3ebb0a925 updated profile layout 2025-08-13 11:08:30 +01:00
CHIEFSOFT\ameye 6421eb5b3e Page layout 2025-08-12 19:01:41 -04:00
ameye 971624a358 Merge branch 'profile-complete' of MERMS/MermsPanelReactJS into master 2025-08-12 21:07:37 +00:00
11 changed files with 90 additions and 31 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

+7 -1
View File
@@ -1,16 +1,22 @@
import React from 'react'
import { Outlet, useLocation } from 'react-router-dom';
import UserMenu from "./layoutcom/UserMenu";
import UserHeader from "./layoutcom/UserHeader";
import UserFooter from "./layoutcom/UserFooter";
import { Outlet } from 'react-router-dom';
import siteLinks from '../../links/siteLinks';
export default function Layout() {
const {pathname} = useLocation()
// const isProfileComplete = pathname == siteLinks.profile_complete
return (
<div className="app">
<div className="app-wrap">
<UserHeader />
<div className="app-container">
<aside className="app-navbar">
<UserMenu />
</aside>
@@ -5,7 +5,7 @@ export default function UserFooter(){
const year = new Date().getFullYear()
return <>
<footer className="footer">
<footer className={`footer`}>
<div className="row">
<div className="col-12 col-sm-6 text-center text-sm-left">
<p>&copy; Copyright {year}. All rights reserved.</p>
@@ -73,7 +73,7 @@ export default function UserHeader(){
<ul className="navbar-nav nav-right ml-auto">
<li className="nav-item user-profile">
<a onClick={toggleMenu} href="#" className="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdow">
<a onClick={toggleMenu} className="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdow">
<img src={getImage('profile-pic-circle.png')} alt="avtar-img" />
<span className="bg-success user-status"></span>
</a>
@@ -4,24 +4,31 @@ import { useLocation } from "react-router-dom";
import { Form, Formik } from "formik";
import * as Yup from "yup";
import { useMutation } from "@tanstack/react-query";
import getImage from "../../utils/getImage";
import { IoMdArrowDropdown } from "react-icons/io";
import { completeProfile } from '../../services/services';
const validationSchema = Yup.object().shape({
username: Yup.string().min(3, "Minimum 3 characters").max(50, "Maximum 50 characters").required("Email is required"),
practice: Yup.string().required("Required"),
specialization: Yup.string().required("Required"),
information: Yup.string().min(1, "Minimum 10 characters").max(50, "Maximum 50 characters").required("Required"),
})
const initialValues = {
username: '',
practice: '',
specialization: '',
information: '',
};
export default function HomeSections(){
export default function ProfileCompleteCom(){
const {state:{profile_completed}} = useLocation()
const mutation = useMutation({
mutationFn: (fields) => {
return ()=>{}
return completeProfile(fields)
},
onSuccess: (res) => {
console.log('res', res)
@@ -30,24 +37,31 @@ export default function HomeSections(){
const handleCompleteProfile = (values, helpers) => {
// helpers.resetForm()
let reqData = {
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid'), // USER UID
// ...values
}
console.log('values', values, helpers)
// mutation.mutate(values)
// mutation.mutate(reqData)
}
return <>
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} />
<div className="row">
<div className="col-xxl-6 m-b-30">
<div className="card card-statistics h-100 mb-0" style={{minHeight: '100px'}}>
{/* <div className="card-header d-flex align-items-center justify-content-between">
<div className="card-heading">
<h4 className="card-title">My Product URLs</h4>
</div>
</div> */}
</div>
</div>
<div className="col-xxl-6 m-b-30">
<div className="row pt-1">
{/*<div className="col-xxl-6 m-b-30">*/}
{/* <div className="card card-statistics h-100 mb-0" style={{minHeight: '100px'}}>*/}
{/* /!* <div className="card-header d-flex align-items-center justify-content-between">*/}
{/* <div className="card-heading">*/}
{/* <h4 className="card-title">My Product URLs</h4>*/}
{/* </div>*/}
{/* </div> *!/*/}
{/* </div>*/}
{/*</div>*/}
<div className="col-md-6 m-b-30">
<div className="card card-statistics h-100 mb-0">
{/* <div className="card-header d-flex align-items-center justify-content-between">
<div className="card-heading">
@@ -63,29 +77,56 @@ export default function HomeSections(){
>
{(props) => {
return (
<Form className=''>
<div className="row">
<Form className='h-100 row flex-column'>
{/* <div className="row"> */}
<>
<div className="col-12">
<div className="form-group">
<label className={`text-black fw-bold control-label ${(props.errors.username && props.touched.username) && 'text-danger'}`}>Username*</label>
<input type="username" name='username' className="form-control" placeholder="Username" value={props.values.username} onChange={props.handleChange} />
<div className="">
<div className="form-group position-relative">
<label className={`text-black fw-bold control-label ${(props.errors.practice && props.touched.practice) && 'text-danger'}`}>Practice :</label>
<div className="position-relative">
<select onChange={props.handleChange} name='practice' value={props.values.practice} className="form-control">
<option value=''>Select</option>
<option value='engineering'>Engineering</option>
</select>
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
</div>
</div>
</div>
{/* {cSignup.error &&
<div className="">
<div className="form-group">
<label className={`text-black fw-bold control-label ${(props.errors.specialization && props.touched.specialization) && 'text-danger'}`}>Specialization :</label>
<div className="position-relative">
<select onChange={props.handleChange} name='specialization' value={props.values.specialization} className="form-control">
<option value=''>Select</option>
<option value='construction'>Construction</option>
</select>
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
</div>
</div>
</div>
<div className="">
<div className="form-group position-relative">
<label className={`text-black fw-bold control-label ${(props.errors.information && props.touched.information) && 'text-danger'}`}>General Information :</label>
<textarea name='information' rows={10} style={{resize: 'none'}} className="form-control" value={props.values.information} onChange={props.handleChange} />
</div>
</div>
{/* {(mutation.isErrorrror || mutation.isSuccess) &&
<>
<div className="col-12">
<p className='text-danger'>{cSignup.error.message}</p>
<p className={`${mutation.isSuccess ? 'text-success' : 'text-danger'}`}>{mutation.isSuccess ? 'Completed successfully' : mutation.error.message}</p>
</div>
</>
} */}
<div className="col-12 mt-3 text-end">
<div className="mt-auto text-end">
<button type='submit' className="btn btn-primary text-uppercase">{false ? 'loading...' : 'Continue'}</button>
</div>
</>
</div>
{/* </div> */}
</Form>
);
}}
@@ -93,6 +134,11 @@ export default function HomeSections(){
</div>
</div>
</div>
<div className="col-md-6 m-b-30">
<div class="text-center img-block left-column wow fadeInRight">
<img className="img-fluid" src={getImage('img-07.png')} alt="content-image" />
</div>
</div>
</div>
</>;
+1 -1
View File
@@ -3,7 +3,7 @@ const siteLinks = {
help: '/help',
home: '/',
dash: '/dash',
profile_complete: '/profile_complete',
profile_complete: '/profile-complete',
product: '/product/*',
contacts: '/contacts',
comments: '/comments',
+8
View File
@@ -167,6 +167,14 @@ export const getSettingsData = (reqData) => {
}
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS
export const completeProfile = (reqData) => {
let postData = {
...reqData,
}
return postAuxEnd(`/panel/`, postData, false)
}
// FUNCTION TO COMPLETE PROFILE
export const getSubscriptions = (reqData) => {
let postData = {
...reqData,
-1
View File
@@ -1,6 +1,5 @@
import ProfileCompleteCom from '../component/profile_complete/ProfileCompleteCom';
export default function ProfileCompletePage(){
return <ProfileCompleteCom />
}