Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move the description in ItemsToolbar to display below the title #1045

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/main/ItemsGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ const ItemsGrid = ({
<div id={gridId}>
<ItemsToolbar
title={title}
subTitleElement={<FolderDescription itemId={parentId} />}
headerElements={headerElements}
onShowOnlyMeChange={onShowOnlyMeChange}
showOnlyMe={showOnlyMe}
/>
<FolderDescription itemId={parentId} />
<Grid container spacing={2}>
{renderItems()}
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/ItemsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ const ItemsTable = ({
<>
<ItemsToolbar
title={tableTitle}
subTitleElement={itemId ? <FolderDescription itemId={itemId} /> : null}
headerElements={headerElements}
onShowOnlyMeChange={onShowOnlyMeChange}
showOnlyMe={showOnlyMe}
/>
{itemId && <FolderDescription itemId={itemId} />}
<GraaspTable
onSortChanged={onSortChanged}
id={tableId}
Expand Down
3 changes: 3 additions & 0 deletions src/components/main/ItemsToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import SelectTypes from '../common/SelectTypes';

type Props = {
title: string;
subTitleElement?: JSX.Element | null;
headerElements?: JSX.Element[];
onShowOnlyMeChange?: ShowOnlyMeChangeType;
showOnlyMe?: boolean;
};

const ItemsToolbar = ({
title,
subTitleElement,
headerElements,
onShowOnlyMeChange,
showOnlyMe,
Expand All @@ -35,6 +37,7 @@ const ItemsToolbar = ({
{headerElements}
</Stack>
</Stack>
{subTitleElement}
<Stack direction="column" mt={2} mb={2} spacing={1}>
{onShowOnlyMeChange && (
<FormControlLabel
Expand Down
Loading