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 7fe6a04a
authored
11 months ago
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
changes
1 parent
0e13ff9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
89 deletions
components/layout/VendorDashboardSidebar.js
components/vendor/ActivityDetails.js
pages/vendor/activities/[id].js
components/layout/VendorDashboardSidebar.js
View file @
7fe6a04
import
Image
from
'next/image'
;
import
{
useRouter
}
from
'next/router'
;
import
React
,
{
useState
}
from
'react'
;
import
Image
from
"next/image"
;
import
{
useRouter
}
from
"next/router"
;
import
React
,
{
useState
}
from
"react"
;
import
{
ToastContainer
}
from
"react-toastify"
;
import
"react-toastify/dist/ReactToastify.css"
;
const
Sidebar
=
()
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
collapsed
,
setCollapsed
]
=
useState
(
false
);
const
[
collapsed
,
setCollapsed
]
=
useState
(
false
);
const
toggleSidebar
=
()
=>
{
setCollapsed
(
!
collapsed
);
};
const
toggleSidebar
=
()
=>
{
setCollapsed
(
!
collapsed
);
};
return
(
<
div
className
=
{
`sidebar
${
collapsed
?
"collapsed"
:
""
}
`
}
>
<
ToastContainer
position
=
"bottom-right"
><
/ToastContainer
>
return
(
<
div
className
=
{
`sidebar
${
collapsed
?
'collapsed'
:
''
}
`
}
>
{
/* <button className="toggle-btn" onClick={toggleSidebar}>
{
/* <button className="toggle-btn" onClick={toggleSidebar}>
Toggle Sidebar
</button> */
}
<
ul
>
<
li
className
=
{
router
.
pathname
===
"/vendor/dashboard"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/dashboard"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-dashboard.svg"
/>
<
span
>
Dashboard
<
/span
>
<
/a
>
<
/li
>
<
li
className
=
{
router
.
pathname
===
"/vendor/orders"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/orders"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-orders.svg"
/>
<
span
>
Orders
<
/span
>
<
/a
>
<
/li
>
<
li
className
=
{
router
.
pathname
===
"/vendor/activities"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/activities"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-activities.svg"
/>
<
span
>
Activities
<
/span
>
<
/a
>
<
/li
>
<
/ul
>
<
/div
>
);
<
ul
>
<
li
className
=
{
router
.
pathname
===
"/vendor/dashboard"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/dashboard"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-dashboard.svg"
/>
<
span
>
Dashboard
<
/span
>
<
/a
>
<
/li
>
<
li
className
=
{
router
.
pathname
===
"/vendor/orders"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/orders"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-orders.svg"
/>
<
span
>
Orders
<
/span
>
<
/a
>
<
/li
>
<
li
className
=
{
router
.
pathname
===
"/vendor/activities"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/activities"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-activities.svg"
/>
<
span
>
Activities
<
/span
>
<
/a
>
<
/li
>
<
/ul
>
<
/div
>
);
};
export
default
Sidebar
;
\ No newline at end of file
export
default
Sidebar
;
This diff is collapsed.
Click to expand it.
components/vendor/ActivityDetails.js
View file @
7fe6a04
...
...
@@ -124,50 +124,49 @@ const monthsArray = [
// import { colourOptions } from '../data';
const
animatedComponents
=
makeAnimated
();
const
ActivityDetails
=
({
isUpdate
})
=>
{
const
ActivityApprovalStatus
=
({
status
})
=>
{
if
(
status
)
{
switch
(
status
)
{
case
true
:
return
(
<
>
<
div
className
=
"
"
>
<
div
className
=
"alert alert-success alert-dismissible fade show text-center"
role
=
"alert
"
>
<
div
className
=
"text-center"
>
<
span
>
<
p
className
=
" text-center"
>
Activity
approved
!
<
CheckCircleTwoTone
twoToneColor
=
"#00b33c"
/
>
<
/
p
>
<
/span
>
<
p
className
=
" text-center"
>
If
you
make
changes
,
the
details
will
be
sent
again
for
approval
.
<
/p
>
const
ActivityApprovalStatus
=
({
status
})
=>
{
if
(
status
)
{
switch
(
status
)
{
case
true
:
return
(
<>
<
div
className
=
" "
>
<
div
className
=
"alert alert-success alert-dismissible fade show text-center"
role
=
"alert
"
>
<
div
className
=
"text-center
"
>
<
span
>
<
p
className
=
" text-center"
>
Activity
approved
!
<
CheckCircleTwoTone
twoToneColor
=
"#00b33c"
/
>
<
/p
>
<
/
span
>
<
p
className
=
" text-center"
>
If
you
make
changes
,
the
details
will
be
sent
again
for
approval
.
<
/p
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/
>
);
<
/
>
);
case
false
:
return
(
<>
<
div
className
=
"col-12 offset-lg-2 col-lg-8 "
>
<
div
className
=
"alert alert-danger alert-dismissible fade show text-center"
role
=
"alert"
>
<
div
className
=
"text-center"
>
<
p
className
=
"p1 text-center"
>
Your
profile
has
been
rejected
!<
/p
>
<
p
className
=
"p2 text-center"
>
Please
contact
the
admin
for
more
details
!<
/p
>
case
false
:
return
(
<>
<
div
className
=
"col-12 offset-lg-2 col-lg-8 "
>
<
div
className
=
"alert alert-danger alert-dismissible fade show text-center"
role
=
"alert"
>
<
div
className
=
"text-center"
>
<
p
className
=
"p1 text-center"
>
Your
profile
has
been
rejected
!<
/p
>
<
p
className
=
"p2 text-center"
>
Please
contact
the
admin
for
more
details
!<
/p
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/
>
);
<
/
>
);
case
"none"
:
return
<><
/>
;
case
"none"
:
return
<><
/>
;
default
:
break
;
default
:
break
;
}
}
}
};
};
const
dispatch
=
useDispatch
();
const
{
categories
}
=
useSelector
(
state
=>
state
.
categories
);
const
{
subCategories
}
=
useSelector
(
state
=>
state
.
subCategories
);
...
...
@@ -335,25 +334,11 @@ const ActivityApprovalStatus = ({ status }) => {
}
let
fromDate
;
let
toDate
;
console
.
log
(
"timeslots"
,
activityPeriodState
);
console
.
log
(
"timeslots"
,
activityPeriodState
,
startDate
,
endDate
);
if
(
!
startDate
||
!
endDate
)
{
fromDate
=
sanitizeTimeRange
({
data
:
activityPeriodState
[
0
]
});
toDate
=
sanitizeTimeRange
({
data
:
activityPeriodState
[
1
]
});
if
(
!
activityPeriodState
||
!
activityPeriodState
.
length
>
0
)
{
// let timeSlots = [];
// timeSlots = timeArray.map(item => {
// console.log("sanitizeTimeFormat({ data: item })", sanitizeTimeFormat({ data: item }));
// if (!sanitizeTimeFormat({ data: item })) {
// console.log("sanitize 1", sanitizeTimeFormat({ data: item }));
// toast.error("Time slots can not be empty!");
// setTimeSlotError(true);
// return;
// }
// console.log("sanitize 2", sanitizeTimeFormat({ data: item }));
// timeSlots = [...timeSlots, sanitizeTimeFormat({ data: item })];
// return sanitizeTimeFormat({ data: item });
// });
toast
.
error
(
"Please select time range"
);
return
;
}
...
...
@@ -1054,9 +1039,12 @@ const ActivityApprovalStatus = ({ status }) => {
<
/div
>
<
div
className
=
"col-6 col-lg-5"
>
<
div
className
=
"input-group"
>
<
Button
onClick
=
{()
=>
{
router
.
push
(
"/vendor/activities"
)
}}
className
=
"btn btn-primary btn-submit"
>
<
Button
onClick
=
{()
=>
{
router
.
push
(
"/vendor/activities"
);
}}
className
=
"btn btn-primary btn-submit"
>
See
all
activities
<
/Button
>
<
/div
>
...
...
This diff is collapsed.
Click to expand it.
pages/vendor/activities/[id].js
View file @
7fe6a04
import
{
Layout
}
from
"antd"
;
import
React
from
"react"
;
// import { ToastContainer } from "react-toastify";
// import "react-toastify/dist/ReactToastify.css";
// import { ToastContainer } from "react-bootstrap";
import
Sidebar
from
"../../../components/layout/VendorDashboardSidebar"
;
import
ActivityDetails
from
"../../../components/vendor/ActivityDetails"
;
import
ActivityListingRBAC
from
"../../../components/vendor/ActivityListingRBAC"
;
...
...
@@ -12,6 +16,8 @@ import { wrapper } from "../../../redux/store";
const
EditActivityDetail
=
()
=>
{
return
(
<
Layout
>
{
/* <ToastContainer position="bottom-right"></ToastContainer> */
}
<
div
className
=
"sidebarContainer"
>
<
Sidebar
/>
<
div
className
=
"content"
>
...
...
This diff is collapsed.
Click to expand it.
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