Skip to content

Commit 331d11e

Browse files
committed
Remove empty state under ownerships table altogether
1 parent b1171a7 commit 331d11e

File tree

1 file changed

+64
-71
lines changed

1 file changed

+64
-71
lines changed

src/pages/organizers/[organizerId]/ownerships/OwnershipsTable.tsx

Lines changed: 64 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -97,84 +97,77 @@ export const OwnershipsTable = ({
9797
);
9898

9999
return (
100-
<>
101-
<Stack
102-
role="table"
103-
flex={1}
104-
padding={4}
105-
marginBottom={5}
106-
borderRadius="0.5rem"
107-
backgroundColor="white"
108-
maxWidth="85rem"
100+
<Stack
101+
role="table"
102+
flex={1}
103+
padding={4}
104+
marginBottom={5}
105+
borderRadius="0.5rem"
106+
backgroundColor="white"
107+
maxWidth="85rem"
108+
css={`
109+
box-shadow: ${getGlobalValue('boxShadow.medium')};
110+
`}
111+
>
112+
<Inline
113+
paddingBottom={3}
109114
css={`
110-
box-shadow: ${getGlobalValue('boxShadow.medium')};
115+
display: grid;
116+
grid-template-columns: repeat(${shouldShowItemId ? 3 : 2}, 1fr);
117+
border-bottom: 1px solid ${grey3};
111118
`}
112119
>
113-
<Inline
114-
paddingBottom={3}
115-
css={`
116-
display: grid;
117-
grid-template-columns: repeat(${shouldShowItemId ? 3 : 2}, 1fr);
118-
border-bottom: 1px solid ${grey3};
119-
`}
120-
>
121-
<Title size={3}>{t('organizers.ownerships.table.user')}</Title>
122-
{shouldShowItemId && <Title size={3}>item id</Title>}
123-
{hasActions && (
124-
<Title size={3} justifyContent="flex-end">
125-
{t('organizers.ownerships.table.actions.title')}
126-
</Title>
127-
)}
128-
</Inline>
129-
<List paddingY={3}>
130-
{creator?.email && <List.Item>{creator.email}</List.Item>}
131-
{requests.map((request) => (
132-
<Inline
133-
key={request.id}
134-
role="row"
135-
alignItems="center"
136-
paddingY={3}
137-
display="grid"
138-
css={`
139-
grid-template-columns: repeat(${shouldShowItemId ? 3 : 2}, 1fr);
120+
<Title size={3}>{t('organizers.ownerships.table.user')}</Title>
121+
{shouldShowItemId && <Title size={3}>item id</Title>}
122+
{hasActions && (
123+
<Title size={3} justifyContent="flex-end">
124+
{t('organizers.ownerships.table.actions.title')}
125+
</Title>
126+
)}
127+
</Inline>
128+
<List paddingY={3}>
129+
{creator?.email && <List.Item>{creator.email}</List.Item>}
130+
{requests.map((request) => (
131+
<Inline
132+
key={request.id}
133+
role="row"
134+
alignItems="center"
135+
paddingY={3}
136+
display="grid"
137+
css={`
138+
grid-template-columns: repeat(${shouldShowItemId ? 3 : 2}, 1fr);
140139
141-
&:not(:last-child) {
142-
border-bottom: 1px solid ${grey3};
143-
}
144-
`}
145-
>
140+
&:not(:last-child) {
141+
border-bottom: 1px solid ${grey3};
142+
}
143+
`}
144+
>
145+
<List.Item>
146+
<Stack>
147+
{shouldShowOwnerId && <Text>{request.ownerId}</Text>}
148+
<Text>{request.ownerEmail}</Text>
149+
</Stack>
150+
</List.Item>
151+
{shouldShowItemId && (
146152
<List.Item>
147153
<Stack>
148-
{shouldShowOwnerId && <Text>{request.ownerId}</Text>}
149-
<Text>{request.ownerEmail}</Text>
154+
<Text>{request.itemId}</Text>
150155
</Stack>
151156
</List.Item>
152-
{shouldShowItemId && (
153-
<List.Item>
154-
<Stack>
155-
<Text>{request.itemId}</Text>
156-
</Stack>
157-
</List.Item>
158-
)}
159-
{hasActions && (
160-
<List.Item justifyContent="flex-end">
161-
<Actions
162-
request={request}
163-
onDelete={onDelete}
164-
onApprove={onApprove}
165-
onReject={onReject}
166-
/>
167-
</List.Item>
168-
)}
169-
</Inline>
170-
))}
171-
</List>
172-
</Stack>
173-
{requests.length === 0 && (
174-
<Alert variant={AlertVariants.WARNING} fullWidth>
175-
{t('organizers.ownerships.table.no_results')}
176-
</Alert>
177-
)}
178-
</>
157+
)}
158+
{hasActions && (
159+
<List.Item justifyContent="flex-end">
160+
<Actions
161+
request={request}
162+
onDelete={onDelete}
163+
onApprove={onApprove}
164+
onReject={onReject}
165+
/>
166+
</List.Item>
167+
)}
168+
</Inline>
169+
))}
170+
</List>
171+
</Stack>
179172
);
180173
};

0 commit comments

Comments
 (0)