Skip to content

Commit

Permalink
fix: [AXIMST-657] Certificates page - update condition to show header…
Browse files Browse the repository at this point in the history
… buttons (#205)

* feat: [AXIMST-605] add file name to upload preview modal (#203)

* fix: [AXIMST-657] Certificates update condition to show header buttons

---------

Co-authored-by: vladislavkeblysh <[email protected]>
Co-authored-by: Kyrylo Hudym-Levkovych <[email protected]>
  • Loading branch information
3 people authored and Kyrylo Hudym-Levkovych committed Mar 22, 2024
1 parent ee29d30 commit 19ed36b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/certificates/Certificates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const MODE_COMPONENTS = {

const Certificates = ({ courseId }) => {
const {
certificates, componentMode, isLoading, loadingStatus,
certificates, componentMode, isLoading, loadingStatus, hasCertificateModes,
} = useCertificates({ courseId });

if (isLoading) {
Expand All @@ -40,7 +40,7 @@ const Certificates = ({ courseId }) => {
const ModeComponent = MODE_COMPONENTS[componentMode] || MODE_COMPONENTS[MODE_STATES.noModes];

return (
<MainLayout courseId={courseId} showHeaderButtons={certificates?.length > 0}>
<MainLayout courseId={courseId} showHeaderButtons={hasCertificateModes && certificates?.length > 0}>
<ModeComponent courseId={courseId} />
</MainLayout>
);
Expand Down
2 changes: 1 addition & 1 deletion src/certificates/hooks/useCertificates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const useCertificates = ({ courseId }) => {
document.title = getPageHeadTitle(courseTitle, intl.formatMessage(messages.headingTitleTabText));

return {
componentMode, isLoading, loadingStatus, certificates,
componentMode, isLoading, loadingStatus, certificates, hasCertificateModes,
};
};

Expand Down

0 comments on commit 19ed36b

Please sign in to comment.