Skip to content

Commit 569038c

Browse files
author
Juli Ovechkina
authored
fix(BasicCard): add target (#162)
1 parent 81173a7 commit 569038c

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/models/constructor-items/sub-blocks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export interface BasicCardProps
140140
Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
141141
url: string;
142142
icon?: ImageProps;
143+
target?: string;
143144
}
144145

145146
export interface BannerCardProps {

src/sub-blocks/BasicCard/BasicCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import './BasicCard.scss';
1212
const b = block('basic-card');
1313

1414
const BasicCard = (props: BasicCardProps) => {
15-
const {url, title, text, border, icon, additionalInfo, links, buttons} = props;
15+
const {title, text, icon, additionalInfo, links, buttons, ...cardParams} = props;
1616
const iconProps = icon && getMediaImage(icon);
1717

1818
return (
19-
<CardBase className={b()} url={url} border={border}>
19+
<CardBase className={b()} {...cardParams}>
2020
<CardBase.Content>
2121
{iconProps && <Image {...iconProps} className={b('icon')} />}
2222
<Content

src/sub-blocks/BasicCard/__stories__/BasicCard.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818

1919
const DefaultTemplate: Story<BasicCardProps> = (args) => (
2020
<div style={{maxWidth: '400px'}}>
21-
<BasicCard {...args} />
21+
<BasicCard {...args} target="_blank" />
2222
</div>
2323
);
2424

src/sub-blocks/BasicCard/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export const BasicCard = {
1818
type: 'string',
1919
},
2020
icon: ImageProps,
21+
target: {
22+
type: 'string',
23+
enum: ['_blank', '_parent', '_top', '_self'],
24+
},
2125
},
2226
},
2327
};

0 commit comments

Comments
 (0)