Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 58e3a2de
authored
2024-06-15 15:39:24 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
fc1b4ee3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
44 deletions
components/layout/Generics/GenericLayout.js
components/layout/Generics/GenericLayout.js
View file @
58e3a2d
...
...
@@ -8,50 +8,54 @@ import { getActivitiesForAdmin } from "../../../redux/actions/activityAction";
import
{
useRouter
}
from
"next/router"
;
export
const
GenericLayout
=
({
children
})
=>
{
const
dispatch
=
useDispatch
();
const
router
=
useRouter
();
const
[
isRoute
,
setIsRoute
]
=
useState
(
""
);
useEffect
(()
=>
{
const
adminUri
=
router
.
pathname
.
includes
(
'admin'
);
const
vendorUri
=
router
.
pathname
.
includes
(
'vendor'
);
setIsRoute
(
adminUri
?
'admin'
:
vendorUri
?
'vendor'
:
''
);
console
.
log
(
'isRoute:'
,
isRoute
);
},
[
router
.
pathname
]);
useEffect
(()
=>
{
dispatch
(
loadUser
());
dispatch
(
getVendorDetails
());
dispatch
(
getActivitiesForAdmin
({}));
},
[]);
const
{
vendorDetails
}
=
useSelector
(
state
=>
state
.
vendorDetails
);
const
{
loadedUser
}
=
useSelector
(
state
=>
state
.
loadedUser
);
return
(
const
dispatch
=
useDispatch
();
const
router
=
useRouter
();
const
[
isRoute
,
setIsRoute
]
=
useState
(
""
);
useEffect
(()
=>
{
const
adminUri
=
router
.
pathname
.
includes
(
"admin"
);
const
vendorUri
=
router
.
pathname
.
includes
(
"vendor"
);
setIsRoute
(
adminUri
?
"admin"
:
vendorUri
?
"vendor"
:
""
);
console
.
log
(
"isRoute:"
,
isRoute
);
},
[
router
.
pathname
]);
useEffect
(()
=>
{
dispatch
(
loadUser
());
dispatch
(
getVendorDetails
());
dispatch
(
getActivitiesForAdmin
({}));
},
[]);
const
{
vendorDetails
}
=
useSelector
(
state
=>
state
.
vendorDetails
);
const
{
loadedUser
}
=
useSelector
(
state
=>
state
.
loadedUser
);
return
(
<
div
style
=
{{
height
:
"100vh"
,
width
:
"100vw"
}}
>
<
GenericHeader
venderBusiness
=
{
vendorDetails
?.
attributes
?.
businessName
}
venderEmail
=
{
vendorDetails
?.
attributes
?.
email
}
adminName
=
{
loadedUser
?.
username
}
adminEmail
=
{
loadedUser
?.
email
}
isRoute
=
{
isRoute
}
/
>
<
div
className
=
"w-100 d-flex"
style
=
{{
height
:
"calc(100vh - 80px)"
}}
>
<
GenericSidebar
isRoute
=
{
isRoute
}
/
>
<
ToastContainer
position
=
"bottom-right"
/>
<
div
style
=
{{
height
:
'100vh'
,
width
:
'100vw'
}}
style
=
{{
width
:
"85%"
,
overflowY
:
"auto"
}}
>
<
GenericHeader
venderBusiness
=
{
vendorDetails
?.
attributes
?.
businessName
}
venderEmail
=
{
vendorDetails
?.
attributes
?.
email
}
adminName
=
{
loadedUser
?.
username
}
adminEmail
=
{
loadedUser
?.
email
}
isRoute
=
{
isRoute
}
/
>
<
div
className
=
"w-100 d-flex"
style
=
{{
height
:
'calc(100vh - 80px)'
,
}}
>
<
GenericSidebar
isRoute
=
{
isRoute
}
/
>
<
div
style
=
{{
width
:
'85%'
,
overflowY
:
'auto'
}}
>
{
children
}
<
/div
>
<
/div
>
{
children
}
<
/div
>
)
}
\ No newline at end of file
<
/div
>
<
/div
>
);
};
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment