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

Commit

Permalink
Merge pull request #6 from commercelayer/update-actions
Browse files Browse the repository at this point in the history
Update actions UI
  • Loading branch information
pfferrari authored Apr 23, 2024
2 parents 828401c + 2f4434f commit fff7232
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
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

0 comments on commit fff7232

Please sign in to comment.