diff --git a/package.json b/package.json
index 87916cad..eb4b12a0 100644
--- a/package.json
+++ b/package.json
@@ -33,11 +33,11 @@
"@emotion/react": "11.13.0",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.13.0",
- "@graasp/query-client": "4.0.2",
- "@graasp/sdk": "4.31.0",
+ "@graasp/query-client": "4.2.0",
+ "@graasp/sdk": "4.32.1",
"@graasp/stylis-plugin-rtl": "2.2.0",
- "@graasp/translations": "1.35.0",
- "@graasp/ui": "5.2.1",
+ "@graasp/translations": "1.40.0",
+ "@graasp/ui": "5.3.1",
"@mui/icons-material": "5.16.7",
"@mui/lab": "5.0.0-alpha.173",
"@mui/material": "5.16.7",
diff --git a/src/components/collection/Collection.tsx b/src/components/collection/Collection.tsx
index f26094cd..3b785dff 100644
--- a/src/components/collection/Collection.tsx
+++ b/src/components/collection/Collection.tsx
@@ -6,7 +6,11 @@ import { useContext, useEffect } from 'react';
import { Box } from '@mui/material';
-import { AccountType } from '@graasp/sdk';
+import {
+ AccountType,
+ PermissionLevel,
+ PermissionLevelCompare,
+} from '@graasp/sdk';
import {
ERROR_INVALID_COLLECTION_ID_CODE,
@@ -18,9 +22,6 @@ import MainWrapper from '../layout/MainWrapper';
import UnpublishedItemAlert from './UnpublishedItemAlert';
import Summary from './summary/Summary';
-// todo: get similar collections in same call
-// import SimilarCollections from './SimilarCollections';
-
type Props = {
id?: string;
};
@@ -32,7 +33,6 @@ const Collection = ({ id }: Props) => {
isError,
} = hooks.useItem(id);
const { data: currentMember } = hooks.useCurrentMember();
- const { data: tags } = hooks.useItemTags(id);
// get item published
const {
data: itemPublishEntry,
@@ -49,8 +49,10 @@ const Collection = ({ id }: Props) => {
postView({ itemId: id, payload: { type: 'collection-view' } });
}
}, [id]);
- // if tags could be fetched then user has at least read access
- const canRead = Boolean(tags);
+
+ const canRead = collection?.permission
+ ? PermissionLevelCompare.gte(collection.permission, PermissionLevel.Read)
+ : false;
const canPublish =
(collection &&
@@ -105,7 +107,6 @@ const Collection = ({ id }: Props) => {
isLoading={isLoadingItem}
totalViews={itemPublishEntry?.totalViews ?? 0}
/>
- {/* */}
>
);
diff --git a/src/components/layout/StyledLink.tsx b/src/components/layout/StyledLink.tsx
index ad040b1d..010aba8e 100644
--- a/src/components/layout/StyledLink.tsx
+++ b/src/components/layout/StyledLink.tsx
@@ -1,5 +1,7 @@
import Link from 'next/link';
+import { ReactNode } from 'react';
+
import { styled } from '@mui/material';
import { HEADER_GRAASP_LOGO_LINK_ID } from '../../config/selectors';
@@ -12,7 +14,7 @@ const StyledLink = styled(Link)(() => ({
const HeaderLinkComponent = ({
children,
}: {
- children: JSX.Element;
+ children: ReactNode;
}): JSX.Element => (