Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PlaceholderContainer): remove href attribute fallback in actions #1947

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading