Skip to content

Commit

Permalink
fix(PlaceholderContainer): remove href attribute fallback in actions (#…
Browse files Browse the repository at this point in the history
…1947)

Co-authored-by: Aleksandr Burobin <lxndr-b@yandex-team.ru>
  • Loading branch information
lxndr and Aleksandr Burobin authored Nov 14, 2024
1 parent 6a09bbc commit 60a8b92
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 60a8b92

Please sign in to comment.