Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Align UI with other updated apps #64

Merged
merged 1 commit into from
Apr 24, 2024
Merged
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
83 changes: 43 additions & 40 deletions packages/app/src/pages/WebhooksList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Icon,
PageLayout,
ResourceList,
Spacer,
useTokenProvider
} from '@commercelayer/app-elements'
import type { FC } from 'react'
Expand Down Expand Up @@ -36,47 +37,49 @@ export const WebhooksList: FC = () => {

return (
<HomePageLayout title='Webhooks'>
<ResourceList
title='All webhooks'
type='webhooks'
query={{
include: ['last_event_callbacks'],
sort: {
created_at: 'desc'
}
}}
actionButton={
canUser('create', 'webhooks') ? (
<Link href={appRoutes.newWebhook.makePath({})}>
<Button
variant='secondary'
size='mini'
alignItems='center'
aria-label='Add webhook'
>
<Icon name='plus' size={16} />
Webhook
</Button>
</Link>
) : undefined
}
ItemTemplate={ListItemWebhook}
emptyState={
<EmptyState
title='No webhook yet!'
description='Create your first webhook'
action={
canUser('create', 'webhooks') ? (
<Link href={appRoutes.newWebhook.makePath({})}>
<Button variant='primary' type='button'>
New webhook
</Button>
</Link>
) : undefined
<Spacer top='14'>
<ResourceList
title='All webhooks'
type='webhooks'
query={{
include: ['last_event_callbacks'],
sort: {
created_at: 'desc'
}
/>
}
/>
}}
actionButton={
canUser('create', 'webhooks') ? (
<Link href={appRoutes.newWebhook.makePath({})}>
<Button
variant='secondary'
size='mini'
alignItems='center'
aria-label='Add webhook'
>
<Icon name='plus' size={16} />
New
</Button>
</Link>
) : undefined
}
ItemTemplate={ListItemWebhook}
emptyState={
<EmptyState
title='No webhook yet!'
description='Create your first webhook'
action={
canUser('create', 'webhooks') ? (
<Link href={appRoutes.newWebhook.makePath({})}>
<Button variant='primary' type='button'>
New webhook
</Button>
</Link>
) : undefined
}
/>
}
/>
</Spacer>
</HomePageLayout>
)
}
Loading