From 07b5496f58866e5dd4bab6830d4df202da514695 Mon Sep 17 00:00:00 2001 From: Aleksandr Burobin Date: Wed, 13 Nov 2024 22:09:32 +0300 Subject: [PATCH] fix(PlaceholderContainer): remove href attribute fallback in actions --- .../PlaceholderContainer/PlaceholderContainer.tsx | 2 +- .../__stories__/PlaceholderContainer.stories.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/PlaceholderContainer/PlaceholderContainer.tsx b/src/components/PlaceholderContainer/PlaceholderContainer.tsx index 2c7fab8bdc..770dbf3156 100644 --- a/src/components/PlaceholderContainer/PlaceholderContainer.tsx +++ b/src/components/PlaceholderContainer/PlaceholderContainer.tsx @@ -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} diff --git a/src/components/PlaceholderContainer/__stories__/PlaceholderContainer.stories.tsx b/src/components/PlaceholderContainer/__stories__/PlaceholderContainer.stories.tsx index 5215c57589..214dc397cd 100644 --- a/src/components/PlaceholderContainer/__stories__/PlaceholderContainer.stories.tsx +++ b/src/components/PlaceholderContainer/__stories__/PlaceholderContainer.stories.tsx @@ -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', @@ -165,7 +171,7 @@ export const Actions: Story = {