Skip to content

Commit

Permalink
fix(PlaceholderContainer): remove href attribute fallback in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Burobin committed Nov 14, 2024
1 parent 6a09bbc commit 07b5496
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const PlaceholderContainerAction = (props: PlaceholderContainerActionProps) => {
size={props.size || 'm'}
loading={Boolean(props.loading)}
disabled={Boolean(props.disabled)}
href={props.href || ''}
href={props.href}
{...(props.onClick ? {onClick: props.onClick} : {})}
>
{props.text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ const actionAdditionalBtnProps: PlaceholderContainerActionProps = {
onClick: () => alert('Click by additional button'),
};

const actionLinkProps: PlaceholderContainerActionProps = {
text: 'Link button',
view: 'flat-info',
href: 'https://gravity-ui.com/',
};

export const Default: Story = {
args: {
title: 'Some title',
Expand Down Expand Up @@ -165,7 +171,7 @@ export const Actions: Story = {
<PlaceholderContainer
{...args}
title="Array of actions"
actions={[actionMainProps, actionAdditionalBtnProps]}
actions={[actionMainProps, actionAdditionalBtnProps, actionLinkProps]}
/>
</Showcase>
<Showcase>
Expand Down

0 comments on commit 07b5496

Please sign in to comment.