Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
add tootip description in block
Browse files Browse the repository at this point in the history
  • Loading branch information
abz53378 committed Oct 19, 2018
1 parent a2db8c4 commit 606a208
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/canner-layouts/src/Block.js
Expand Up @@ -2,7 +2,7 @@

import * as React from 'react';
import {Item} from 'canner-helpers';
import {Card} from 'antd';
import {Card, Tooltip, Icon} from 'antd';

type Props = {
style: Object,
Expand All @@ -13,12 +13,20 @@ type Props = {
extra: string | React.Node,
hoverable: boolean,
title: string,
type: string
type: string,
description: string,
};

export default class Block extends React.Component<Props> {
render() {
const {style, headStyle, bodyStyle, bordered, cover, extra, hoverable, title, type} = this.props
const {style, headStyle, bodyStyle, bordered, cover, hoverable, title, type, description} = this.props
const extra = this.props.extra || (
description && (
<Tooltip placement="top" title={description}>
<Icon type="info-circle-o" style={{marginLeft: 12, color: '#aaa'}}/>
</Tooltip>
)
)
return <Card
headStyle={headStyle}
bodyStyle={bodyStyle}
Expand Down

0 comments on commit 606a208

Please sign in to comment.