Skip to content

Commit

Permalink
feat: add iconLeft prop to CustomFormDetailPage.FormPrimaryButton (
Browse files Browse the repository at this point in the history
  • Loading branch information
ragafus authored Jul 9, 2024
1 parent 67a35e2 commit 113bace
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/metal-hotels-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-components': minor
---

Add `iconLeft` prop to `CustomFormDetailPage.FormPrimaryButton`
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ const useFormattedLabel = (label: Label) => {
return typeof label === 'string' ? label : intl.formatMessage(label);
};

const FormPrimaryButton = (props: Props) => {
type PrimaryButtonProps = {
iconLeft?: ReactElement;
} & Props;

const FormPrimaryButton = (props: PrimaryButtonProps) => {
const label = useFormattedLabel(props.label);

return (
<PrimaryButton
label={label}
onClick={props.onClick}
isDisabled={props.isDisabled}
iconLeft={props.iconLeft}
{...filterDataAttributes(props.dataAttributes)}
/>
);
Expand Down

0 comments on commit 113bace

Please sign in to comment.