Skip to content

Commit

Permalink
Merge pull request #735 from JiscSD/OC-983
Browse files Browse the repository at this point in the history
OC-983: Peer reviews do not load whilst logged in
  • Loading branch information
finlay-jisc authored Dec 10, 2024
2 parents d1b26b4 + e220f36 commit 41b4452
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@ type Props = {
const HeaderActions: React.FC<Props> = (props) => {
const { user } = Stores.useAuthStore();

if (!user) {
if (!user || props.publicationType === 'PEER_REVIEW') {
return null;
}

return (
<div className="col-span-8 mb-10 pb-10 flex flex-col md:flex-row gap-4 md:gap-8 border-b border-grey-200">
{Helpers.linkedPublicationTypes[props.publicationType as keyof typeof Helpers.linkedPublicationTypes].map(
(childPublicationType) => {
return (
<Components.Button
variant="block"
title={`Write a linked ${Helpers.formatPublicationType(childPublicationType as Types.PublicationType)}`}
key={childPublicationType}
href={`${Config.urls.createPublication.path}?for=${props.publicationId}&type=${childPublicationType}`}
openNew={true}
/>
);
}
)}
{Helpers.linkedPublicationTypes[props.publicationType].map((childPublicationType) => {
return (
<Components.Button
variant="block"
title={`Write a linked ${Helpers.formatPublicationType(childPublicationType as Types.PublicationType)}`}
key={childPublicationType}
href={`${Config.urls.createPublication.path}?for=${props.publicationId}&type=${childPublicationType}`}
openNew={true}
/>
);
})}
{!props.authorIds.includes(user.id) && (
<Components.Button
title="Write a review"
Expand Down

0 comments on commit 41b4452

Please sign in to comment.