Skip to content

Commit

Permalink
Add shouldShowItemId
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-debruijn committed Nov 21, 2024
1 parent 2260698 commit f1a6e09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/pages/manage/ownerships/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const OwnershipsOverviewPage = () => {
{getOwnershipRequestsQuery.isLoading ? (
<Spinner />
) : (
<OwnershipsTable requests={requests} />
<OwnershipsTable requests={requests} shouldShowItemId />
)}

{hasMoreThanOnePage && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ const Actions = ({ request, onDelete, onApprove, onReject }: ActionProps) => {

type Props = {
requests: OwnershipRequest[];
shouldShowItemId: boolean;
} & ActionHandlers;

export const OwnershipsTable = ({
requests,
onDelete,
onApprove,
onReject,
shouldShowItemId = false,
}: Props) => {
const { grey3 } = colors;
const { t } = useTranslation();
Expand Down Expand Up @@ -99,14 +101,14 @@ export const OwnershipsTable = ({
paddingBottom={3}
css={`
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: 1fr 2fr 1fr;
border-bottom: 1px solid ${grey3};
`}
>
<Title size={3}>{t('organizers.ownerships.table.user')}</Title>
<Title size={3}>item id</Title>
{shouldShowItemId && <Title size={3}>item id</Title>}
{hasActions && (
<Title size={3} justifyContent="flex-end">
<Title size={3}>
{t('organizers.ownerships.table.actions.title')}
</Title>
)}
Expand All @@ -119,17 +121,17 @@ export const OwnershipsTable = ({
paddingY={3}
css={`
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: 1fr 2fr 1fr;
&:not(:last-child) {
border-bottom: 1px solid ${grey3};
}
`}
>
<List.Item>{request.ownerEmail}</List.Item>
<List.Item>{request.itemId}</List.Item>
{shouldShowItemId && <List.Item>{request.itemId}</List.Item>}
{hasActions && (
<List.Item justifyContent="flex-end">
<List.Item>
<Actions
request={request}
onDelete={onDelete}
Expand Down

0 comments on commit f1a6e09

Please sign in to comment.