New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨(frontend) split dashboard certifiate page #2370
✨(frontend) split dashboard certifiate page #2370
Conversation
25ddcbe
to
cd8ce34
Compare
cd8ce34
to
95dd442
Compare
7e6e527
to
80b434a
Compare
<Tabs.Tab | ||
name="enrollment-certificate-tab" | ||
initialIsActive={certificateType === CertificateType.ENROLLMENT} | ||
href={generatePath(LearnerDashboardPaths.ENROLLMENT_CERTIFICATES)} | ||
> | ||
<FormattedMessage {...messages.enrollmentCertificateTabLabel} /> | ||
</Tabs.Tab> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just remember that we talked to hide this tab if the user has no certificate of this kind. Maybe we could do that in another PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefere yes, it's a different journey.
edit: PR #2387
80b434a
to
034fc91
Compare
876fce1
to
034a2c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last few comments then it will be good
const TabContextProvider = ({ | ||
initialActiveTabName, | ||
children, | ||
}: PropsWithChildren & { initialActiveTabName?: string }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}: PropsWithChildren & { initialActiveTabName?: string }) => { | |
}: PropsWithChildren<{ initialActiveTabName?: string }>) => { |
const Tabs = ({ | ||
initialActiveTabName, | ||
children, | ||
}: PropsWithChildren & { initialActiveTabName: string }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}: PropsWithChildren & { initialActiveTabName: string }) => { | |
}: PropsWithChildren<{ initialActiveTabName: string }>) => { |
const { activeTabName, setActiveTabName } = useContext(TabsContext); | ||
const navigate = useNavigate(); | ||
|
||
const isActive = !!activeTabName && activeTabName === name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work ?
const isActive = !!activeTabName && activeTabName === name; | |
const isActive = activeTabName === name; |
{certificates.items.length === 0 && ( | ||
<Banner message={intl.formatMessage(messages.empty)} type={BannerType.INFO} /> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we should not display this banner until we are fetching data.
Currently, there is flickering effect when switching tab.
CleanShot.2024-05-15.at.19.29.28.mp4
e40c1ed
to
ba8f711
Compare
f4c5d06
to
9916c59
Compare
9916c59
to
330d141
Compare
We need a basic tab component to render two linked section in the learner dashbaord certificates page.
build cunningham theme with new entries for tabs.
joanie's certificate endpoint now return only order's certificate by default. to retrive enrollments certificate we need a second request with the right filter. Here we add tab in learner dashboard certificate page to render both list: order and enrollments certificates
certificate entry on learner sidebar menu can render multiple routes: * order certificate * enrollment certificate our menu item must be selected when any of theses two route is active.
330d141
to
bb2ec6e
Compare
Purpose
joanie's certificate endpoint now return only order's certificate by
default.
to retrive enrollments certificate we need a second request with the
right filter.
Here we add tab in learner dashboard certificate page to render both
list: order and enrollments certificates
Capture vidéo du 25-04-2024 16:39:29.webm