Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyichen committed Oct 25, 2023
1 parent b5a1862 commit d4788ca
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
20 changes: 13 additions & 7 deletions src/components/Libraries/LibraryEntityPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,19 @@ const BulkAction = ({
return (
<Flex justifyContent="space-between" backgroundColor="gray.50" p={4}>
<HStack gap={2}>
<Checkbox
size="md"
isChecked={isAllSelected}
isIndeterminate={!isAllSelected && isSomeSelected}
onChange={handleChange}
mr={2}
/>
<Tooltip
label={
isAllSelected || isSomeSelected ? 'clear selected papers on this page' : 'select all papers on this page'
}
>
<Checkbox
size="md"
isChecked={isAllSelected}
isIndeterminate={!isAllSelected && isSomeSelected}
onChange={handleChange}
mr={2}
/>
</Tooltip>
{selectedCount > 0 && (
<>
<>{selectedCount} selected</>
Expand Down
15 changes: 12 additions & 3 deletions src/pages/user/libraries/[[...id]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,18 @@ const LibrariesHome: NextPage<ILibrariesHomeProps> = ({ id, subpage }) => {
}
/>
)}
{!!id && !!library && !subpage && <LibraryEntityPane library={library} publicView={false} onRefetch={refetch} />}
{!!id && !!library && subpage === 'settings' && <LibrarySettingsPane library={library} onRefetch={refetch} />}
{!id && <LibrariesLandingPane />}

{!!id && !!library ? (
<>
{subpage === 'settings' ? (
<LibrarySettingsPane library={library} onRefetch={refetch} />
) : (
<LibraryEntityPane library={library} publicView={false} onRefetch={refetch} />
)}
</>
) : (
<>{!id ? <LibrariesLandingPane /> : null}</>
)}
</>
);
};
Expand Down

0 comments on commit d4788ca

Please sign in to comment.