Skip to content
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
1 change: 1 addition & 0 deletions src/models/constructor-items/sub-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export interface BasicCardProps
Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
url: string;
icon?: ImageProps;
target?: string;
}

export interface BannerCardProps {
Expand Down
4 changes: 2 additions & 2 deletions src/sub-blocks/BasicCard/BasicCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import './BasicCard.scss';
const b = block('basic-card');

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

return (
<CardBase className={b()} url={url} border={border}>
<CardBase className={b()} {...cardParams}>
<CardBase.Content>
{iconProps && <Image {...iconProps} className={b('icon')} />}
<Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {

const DefaultTemplate: Story<BasicCardProps> = (args) => (
<div style={{maxWidth: '400px'}}>
<BasicCard {...args} />
<BasicCard {...args} target="_blank" />
</div>
);

Expand Down
4 changes: 4 additions & 0 deletions src/sub-blocks/BasicCard/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const BasicCard = {
type: 'string',
},
icon: ImageProps,
target: {
type: 'string',
enum: ['_blank', '_parent', '_top', '_self'],
},
},
},
};