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

feat: completed all functions of the card component and wrote test sa… #87

Merged
merged 9 commits into from
Jul 31, 2024

Conversation

zyy-bupt2022
Copy link
Contributor

@zyy-bupt2022 zyy-bupt2022 marked this pull request as draft July 12, 2024 09:35
@zyy-bupt2022 zyy-bupt2022 marked this pull request as ready for review July 12, 2024 09:36
合并最新主分支代码
export interface CardProps extends TdCardProps, StyledProps {}

@tag('t-card')
export default class Card extends Component<CardProps> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少 propTypes,参考其他组件

Comment on lines 74 to 109
const headerClass = classname({
[`${classPrefix}-card__header`]: showHeader,
[`${classPrefix}-card__title--bordered`]: headerBordered,
});

const titleClass = classname({
[`${classPrefix}-card__title`]: title,
});

const subtitleClass = classname({
[`${classPrefix}-card__subtitle`]: subtitle,
});

const actionClass = classname({
[`${classPrefix}-card__actions`]: actions,
});

const footerClass = classname({
[`${classPrefix}-card__footer`]: footer,
});

const coverClass = classname({
[`${classPrefix}-card__cover`]: cover,
});

const avatarClass = classname({
[`${classPrefix}-card__avatar`]: avatar,
});

const bodyClass = classname({
[`${classPrefix}-card__body`]: children,
});

const descriptionClass = classname({
[`${classPrefix}-card__description`]: description,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所有的class,放在对应的dom处定义

@@ -0,0 +1,10 @@
// 临时col
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 grid 组件

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除此目录

@@ -0,0 +1,16 @@
// 临时row
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除此目录,使用grid组件

@@ -0,0 +1,10 @@
// 临时tag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag组件已经有了,是不是没合最新代码?

Copy link

github-actions bot commented Jul 25, 2024

完成

avatar: Object,
bordered: Boolean,
content: Object,
cover: [Object, String],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所有TNode类型需要设置[String,Number,Object,Function],其它地方同理

Comment on lines 85 to 88
const titleClass = classname({
[`${classPrefix}-card__title`]: title,
});
const renderTitle = title ? <div className={titleClass}>{title}</div> : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const renderTitle = title ? <div className={classname({
      [`${classPrefix}-card__title`]: title,
    })}>{title}</div> : null;

其它地方同理

Comment on lines 89 to 96
<div
className={classname({
[`${classPrefix}-card__title`]: title,
})}
>
{title}
</div>
) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这种场景下,title一定为true
直接写

title ? (
      <div
        className={`${classPrefix}-card__title`}
      >
        {title}
      </div>
    ) : null;

@duenyang duenyang merged commit 44928b4 into TDesignOteam:main Jul 31, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants