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

Update actions UI #6

Merged
merged 1 commit into from
Apr 23, 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
11 changes: 10 additions & 1 deletion packages/app/src/components/PriceTiers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,17 @@ export const PriceTiers: FC<Props> = ({
priceListId,
priceId: price.id
})}
asChild
>
Add tier
<Button
variant='secondary'
size='mini'
alignItems='center'
aria-label='Add tier'
>
<Icon name='plus' />
Tier
</Button>
</Link>
)
}
Expand Down
13 changes: 12 additions & 1 deletion packages/app/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Button,
EmptyState,
HomePageLayout,
Icon,
useResourceFilters,
useTokenProvider
} from '@commercelayer/app-elements'
Expand Down Expand Up @@ -79,7 +80,17 @@ export function Home(): JSX.Element {
}
actionButton={
canUser('create', 'price_lists') ? (
<Link href={appRoutes.priceListNew.makePath({})}>Add new</Link>
<Link href={appRoutes.priceListNew.makePath({})} asChild>
<Button
variant='secondary'
size='mini'
alignItems='center'
aria-label='Add price list'
>
<Icon name='plus' />
Price list
</Button>
</Link>
) : undefined
}
/>
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/pages/PriceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DropdownDivider,
DropdownItem,
EmptyState,
Icon,
PageLayout,
SkeletonTemplate,
Spacer,
Expand Down Expand Up @@ -93,6 +94,11 @@ export function PriceDetails(): JSX.Element {

const contextMenu = (
<Dropdown
dropdownLabel={
<Button variant='secondary' size='small'>
<Icon name='dotsThree' size={16} weight='bold' />
</Button>
}
dropdownItems={
<>
{contextMenuEdit}
Expand Down
18 changes: 16 additions & 2 deletions packages/app/src/pages/PricesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DropdownDivider,
DropdownItem,
EmptyState,
Icon,
PageLayout,
SkeletonTemplate,
useCoreSdkProvider,
Expand Down Expand Up @@ -95,6 +96,11 @@ export function PricesList(): JSX.Element {

const contextMenu = (
<Dropdown
dropdownLabel={
<Button variant='secondary' size='small'>
<Icon name='dotsThree' size={16} weight='bold' />
</Button>
}
dropdownItems={
<>
{contextMenuEdit}
Expand Down Expand Up @@ -153,8 +159,16 @@ export function PricesList(): JSX.Element {
}}
actionButton={
canUser('create', 'prices') && (
<Link href={appRoutes.priceNew.makePath({ priceListId })}>
Add new
<Link href={appRoutes.priceNew.makePath({ priceListId })} asChild>
<Button
variant='secondary'
size='mini'
alignItems='center'
aria-label='Add price'
>
<Icon name='plus' />
Price
</Button>
</Link>
)
}
Expand Down
Loading