Skip to content

Commit

Permalink
fix: Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Jun 3, 2024
1 parent 14933d2 commit 975b8db
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
5 changes: 3 additions & 2 deletions src/studio-home/data/apiHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { useQuery } from '@tanstack/react-query';

import { getStudioHomeLibrariesV2 } from './api';


/**
* Builds the query to fetch list of V2 Libraries
*/
export const useListStudioHomeV2Libraries = (customParams) => (
const useListStudioHomeV2Libraries = (customParams) => (
useQuery({
queryKey: ['listV2Libraries', customParams],
queryFn: () => getStudioHomeLibrariesV2(customParams),
})
);

export default useListStudioHomeV2Libraries;
1 change: 0 additions & 1 deletion src/studio-home/tabs-section/LibraryV2Placeholder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Header from '../../header';
import SubHeader from '../../generic/sub-header/SubHeader';
import messages from './messages';


const LibraryV2Placeholder = () => {
const intl = useIntl();

Expand Down
47 changes: 27 additions & 20 deletions src/studio-home/tabs-section/libraries-v2-tab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Icon, Row, Pagination } from '@openedx/paragon';
import { useIntl } from '@edx/frontend-platform/i18n';

import { useListStudioHomeV2Libraries } from '../../data/apiHooks';
import useListStudioHomeV2Libraries from '../../data/apiHooks';
import { LoadingSpinner } from '../../../generic/Loading';
import AlertMessage from '../../../generic/alert-message';
import CardItem from '../../card-item';
Expand All @@ -25,7 +25,7 @@ const LibrariesV2Tab = ({
data,
isLoading,
isError,
} = useListStudioHomeV2Libraries({page: currentPage});
} = useListStudioHomeV2Libraries({ page: currentPage });

if (isLoading) {
return (
Expand Down Expand Up @@ -68,25 +68,32 @@ const LibrariesV2Tab = ({
</p>
</div>

{data.results.map(({ id, org, slug, title }) => (
<CardItem
key={`${org}+${slug}`}
isLibraries
displayName={title}
org={org}
number={slug}
url={libURL(id)}
/>
))}
{
data.results.map(({
id, org, slug, title,
}) => (
<CardItem
key={`${org}+${slug}`}
isLibraries
displayName={title}
org={org}
number={slug}
url={libURL(id)}
/>
))
}

{data.numPages > 1 &&
<Pagination
className="d-flex justify-content-center"
paginationLabel="pagination navigation"
pageCount={data.numPages}
currentPage={currentPage}
onPageSelect={handlePageSelect}
/>
{
data.numPages > 1
&& (
<Pagination
className="d-flex justify-content-center"
paginationLabel="pagination navigation"
pageCount={data.numPages}
currentPage={currentPage}
onPageSelect={handlePageSelect}
/>
)
}
</div>
)
Expand Down

0 comments on commit 975b8db

Please sign in to comment.