feat(market): 修改组件仓库中组件列表的布局,增加新内容渲染以及组件语言渲染

feature
钟良源 1 month ago
parent 8bc11c0de1
commit 347becdec0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

@ -309,6 +309,8 @@ const Market: React.FC<MarketProps> = ({ updateProjectComp }) => {
// 转换为数组格式
const resultComponents = Object.values(mergedComponents);
console.log('resultComponents', resultComponents);
// 如果没有组件,显示提示信息
if (resultComponents.length === 0) {
return (
@ -365,7 +367,18 @@ const Market: React.FC<MarketProps> = ({ updateProjectComp }) => {
<div className={styles['component-list']}>
<div className={styles['component-info']}>
<img src="/icons/compIcon.png" alt="" />
<span>{component.label || component.flowName}</span>
<div className={styles['component-text']}>
<div className={styles['component-header']}>
<span className={styles['component-flowName']}>{component.label || component.flowName}</span>
{component?.comp?.codeLanguage && (
<Tag size="small" color="arcoblue" className={styles['component-language-tag']}>
{component.comp.codeLanguage}
</Tag>
)}
</div>
<span className={styles['component-identifier']}>{component?.comp?.identifier}</span>
<span className={styles['component-author']}>{component?.comp?.author}</span>
</div>
</div>
{/*两种状态 未添加的是primary 已添加的是secondary*/}
{

@ -44,16 +44,57 @@
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
padding-top: 10px;
.component-info {
min-width: 0;
flex: 1;
display: flex;
align-items: center;
img {
width: 40px;
height: 40px;
margin-right: 10px;
width: 45px;
height: 45px;
margin-right: 15px;
flex-shrink: 0;
}
.component-text {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
.component-header {
min-width: 0;
display: flex;
align-items: center;
gap: 8px;
}
.component-flowName {
min-width: 0;
font-size: 16px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.component-language-tag {
flex-shrink: 0;
}
.component-identifier,
.component-author {
font-size: 12px;
color: #adadad;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}

Loading…
Cancel
Save