Compare commits

...

3 Commits

Author SHA1 Message Date
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 103 additions and 33 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

+17 -1
View File
@@ -1,16 +1,31 @@
import React from 'react' import React from 'react'
import { Outlet, useLocation } from 'react-router-dom';
import UserMenu from "./layoutcom/UserMenu"; import UserMenu from "./layoutcom/UserMenu";
import UserHeader from "./layoutcom/UserHeader"; import UserHeader from "./layoutcom/UserHeader";
import UserFooter from "./layoutcom/UserFooter"; import UserFooter from "./layoutcom/UserFooter";
import { Outlet } from 'react-router-dom'; import siteLinks from '../../links/siteLinks';
export default function Layout() { export default function Layout() {
const {pathname} = useLocation()
const isProfileComplete = pathname == siteLinks.profile_complete
return ( return (
<div className="app"> <div className="app">
{isProfileComplete ?
<div className="app-wrap">
<UserHeader />
<div className="container-fluid">
<Outlet />
</div>
<UserFooter isProfileComplete={isProfileComplete} />
</div>
:
<div className="app-wrap"> <div className="app-wrap">
<UserHeader /> <UserHeader />
<div className="app-container"> <div className="app-container">
<aside className="app-navbar"> <aside className="app-navbar">
<UserMenu /> <UserMenu />
</aside> </aside>
@@ -22,6 +37,7 @@ export default function Layout() {
</div> </div>
<UserFooter /> <UserFooter />
</div> </div>
}
</div> </div>
) )
} }
@@ -1,11 +1,11 @@
import React from "react"; import React from "react";
export default function UserFooter(){ export default function UserFooter({isProfileComplete=false}){
const year = new Date().getFullYear() const year = new Date().getFullYear()
return <> return <>
<footer className="footer"> <footer className={`${isProfileComplete && 'w-100'} footer`}>
<div className="row"> <div className="row">
<div className="col-12 col-sm-6 text-center text-sm-left"> <div className="col-12 col-sm-6 text-center text-sm-left">
<p>&copy; Copyright {year}. All rights reserved.</p> <p>&copy; Copyright {year}. All rights reserved.</p>
@@ -73,7 +73,7 @@ export default function UserHeader(){
<ul className="navbar-nav nav-right ml-auto"> <ul className="navbar-nav nav-right ml-auto">
<li className="nav-item user-profile"> <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" /> <img src={getImage('profile-pic-circle.png')} alt="avtar-img" />
<span className="bg-success user-status"></span> <span className="bg-success user-status"></span>
</a> </a>
@@ -4,24 +4,31 @@ import { useLocation } from "react-router-dom";
import { Form, Formik } from "formik"; import { Form, Formik } from "formik";
import * as Yup from "yup"; import * as Yup from "yup";
import { useMutation } from "@tanstack/react-query"; 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({ 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 = { const initialValues = {
username: '', practice: '',
specialization: '',
information: '',
}; };
export default function HomeSections(){ export default function ProfileCompleteCom(){
const {state:{profile_completed}} = useLocation() const {state:{profile_completed}} = useLocation()
const mutation = useMutation({ const mutation = useMutation({
mutationFn: (fields) => { mutationFn: (fields) => {
return ()=>{} return completeProfile(fields)
}, },
onSuccess: (res) => { onSuccess: (res) => {
console.log('res', res) console.log('res', res)
@@ -30,24 +37,32 @@ export default function HomeSections(){
const handleCompleteProfile = (values, helpers) => { const handleCompleteProfile = (values, helpers) => {
// helpers.resetForm() // helpers.resetForm()
let reqData = {
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid'), // USER UID
// ...values
}
console.log('values', values, helpers) console.log('values', values, helpers)
// mutation.mutate(values) // mutation.mutate(reqData)
} }
return <> return <>
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} /> <div style={{marginTop: '90px'}}>
<BreadcrumbComBS title='Update Profile' paths={['Dashboard', 'Profile']} />
</div>
<div className="row"> <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="col-xxl-6 m-b-30">*/}
{/* <div className="card-header d-flex align-items-center justify-content-between"> {/* <div className="card card-statistics h-100 mb-0" style={{minHeight: '100px'}}>*/}
<div className="card-heading"> {/* /!* <div className="card-header d-flex align-items-center justify-content-between">*/}
<h4 className="card-title">My Product URLs</h4> {/* <div className="card-heading">*/}
</div> {/* <h4 className="card-title">My Product URLs</h4>*/}
</div> */} {/* </div>*/}
</div> {/* </div> *!/*/}
</div> {/* </div>*/}
<div className="col-xxl-6 m-b-30"> {/*</div>*/}
<div className="col-md-6 m-b-30">
<div className="card card-statistics h-100 mb-0"> <div className="card card-statistics h-100 mb-0">
{/* <div className="card-header d-flex align-items-center justify-content-between"> {/* <div className="card-header d-flex align-items-center justify-content-between">
<div className="card-heading"> <div className="card-heading">
@@ -63,29 +78,56 @@ export default function HomeSections(){
> >
{(props) => { {(props) => {
return ( return (
<Form className=''> <Form className='h-100 row flex-column'>
<div className="row"> {/* <div className="row"> */}
<> <>
<div className="col-12"> <div className="">
<div className="form-group"> <div className="form-group position-relative">
<label className={`text-black fw-bold control-label ${(props.errors.username && props.touched.username) && 'text-danger'}`}>Username*</label> <label className={`text-black fw-bold control-label ${(props.errors.practice && props.touched.practice) && 'text-danger'}`}>Practice :</label>
<input type="username" name='username' className="form-control" placeholder="Username" value={props.values.username} onChange={props.handleChange} /> <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>
</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"> <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>
</> </>
} */} } */}
<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> <button type='submit' className="btn btn-primary text-uppercase">{false ? 'loading...' : 'Continue'}</button>
</div> </div>
</> </>
</div> {/* </div> */}
</Form> </Form>
); );
}} }}
@@ -93,6 +135,11 @@ export default function HomeSections(){
</div> </div>
</div> </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> </div>
</>; </>;
+1 -1
View File
@@ -3,7 +3,7 @@ const siteLinks = {
help: '/help', help: '/help',
home: '/', home: '/',
dash: '/dash', dash: '/dash',
profile_complete: '/profile_complete', profile_complete: '/profile-complete',
product: '/product/*', product: '/product/*',
contacts: '/contacts', contacts: '/contacts',
comments: '/comments', comments: '/comments',
+8
View File
@@ -167,6 +167,14 @@ export const getSettingsData = (reqData) => {
} }
// FUNCTION TO GET PRODUCT SUBSCRIPTIONS // 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) => { export const getSubscriptions = (reqData) => {
let postData = { let postData = {
...reqData, ...reqData,
-1
View File
@@ -1,6 +1,5 @@
import ProfileCompleteCom from '../component/profile_complete/ProfileCompleteCom'; import ProfileCompleteCom from '../component/profile_complete/ProfileCompleteCom';
export default function ProfileCompletePage(){ export default function ProfileCompletePage(){
return <ProfileCompleteCom /> return <ProfileCompleteCom />
} }