|
@@ -1,6 +1,6 @@
|
|
|
import * as React from 'react';
|
|
import * as React from 'react';
|
|
|
import { Dropdown, MenuProps, Button } from 'antd';
|
|
import { Dropdown, MenuProps, Button } from 'antd';
|
|
|
-import { CodeBracketsSquare, EditPencil, Trash, ShareIos, Star, BrightStar, Eye, Heart, Calendar, BadgeCheck, Building, Menu, ArrowRight } from 'iconoir-react';
|
|
|
|
|
|
|
+import { Code, Pen, Trash2, Share2, Star, Eye, Heart, Calendar, BadgeCheck, Building, Menu, ArrowRight } from 'lucide-react';
|
|
|
import './index.scss';
|
|
import './index.scss';
|
|
|
|
|
|
|
|
export interface AppCardProps {
|
|
export interface AppCardProps {
|
|
@@ -143,7 +143,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
items.push({
|
|
items.push({
|
|
|
key: 'api',
|
|
key: 'api',
|
|
|
label: 'API 调用',
|
|
label: 'API 调用',
|
|
|
- icon: <CodeBracketsSquare width="16" height="16" />,
|
|
|
|
|
|
|
+ icon: <Code size={16} />,
|
|
|
onClick: () => onApi(),
|
|
onClick: () => onApi(),
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -152,7 +152,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
items.push({
|
|
items.push({
|
|
|
key: 'edit',
|
|
key: 'edit',
|
|
|
label: '编辑',
|
|
label: '编辑',
|
|
|
- icon: <EditPencil width="16" height="16" />,
|
|
|
|
|
|
|
+ icon: <Pen size={16} />,
|
|
|
onClick: () => onEdit(),
|
|
onClick: () => onEdit(),
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -161,7 +161,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
items.push({
|
|
items.push({
|
|
|
key: 'delete',
|
|
key: 'delete',
|
|
|
label: '删除',
|
|
label: '删除',
|
|
|
- icon: <Trash width="16" height="16" />,
|
|
|
|
|
|
|
+ icon: <Trash2 size={16} />,
|
|
|
danger: true,
|
|
danger: true,
|
|
|
onClick: () => onDelete(),
|
|
onClick: () => onDelete(),
|
|
|
});
|
|
});
|
|
@@ -211,7 +211,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
}}
|
|
}}
|
|
|
title='分享'
|
|
title='分享'
|
|
|
>
|
|
>
|
|
|
- <ShareIos width="18" height="18" />
|
|
|
|
|
|
|
+ <Share2 size={18} />
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
className='card-action-btn'
|
|
className='card-action-btn'
|
|
@@ -222,9 +222,9 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
title={isCollect ? '取消收藏' : '收藏'}
|
|
title={isCollect ? '取消收藏' : '收藏'}
|
|
|
>
|
|
>
|
|
|
{isCollect ? (
|
|
{isCollect ? (
|
|
|
- <BrightStar width="18" height="18" style={{ color: '#F5E663' }} />
|
|
|
|
|
|
|
+ <Star size={18} className="fill-yellow" style={{ color: '#F5E663' }} />
|
|
|
) : (
|
|
) : (
|
|
|
- <Star width="18" height="18" />
|
|
|
|
|
|
|
+ <Star size={18} />
|
|
|
)}
|
|
)}
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -238,7 +238,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
) : icon ? (
|
|
) : icon ? (
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: 24, height: 24 }}>
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: 24, height: 24 }}>
|
|
|
{/* 动态 icon 支持 - 如果传入的是 iconoir 组件名称则渲染,否则显示占位 */}
|
|
{/* 动态 icon 支持 - 如果传入的是 iconoir 组件名称则渲染,否则显示占位 */}
|
|
|
- <BrightStar width="24" height="24" />
|
|
|
|
|
|
|
+ <Star size={24} />
|
|
|
</div>
|
|
</div>
|
|
|
) : null}
|
|
) : null}
|
|
|
</div>
|
|
</div>
|
|
@@ -279,13 +279,13 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
<div className='card-meta-left'>
|
|
<div className='card-meta-left'>
|
|
|
{showViewCount && viewCount !== undefined && (
|
|
{showViewCount && viewCount !== undefined && (
|
|
|
<span className='card-meta-item'>
|
|
<span className='card-meta-item'>
|
|
|
- <Eye width="14" height="14" />
|
|
|
|
|
|
|
+ <Eye size={14} />
|
|
|
<span>{viewCount}</span>
|
|
<span>{viewCount}</span>
|
|
|
</span>
|
|
</span>
|
|
|
)}
|
|
)}
|
|
|
{showFavoriteCount && favoriteCount !== undefined && (
|
|
{showFavoriteCount && favoriteCount !== undefined && (
|
|
|
<span className='card-meta-item'>
|
|
<span className='card-meta-item'>
|
|
|
- <Heart width="14" height="14" />
|
|
|
|
|
|
|
+ <Heart size={14} />
|
|
|
<span>{favoriteCount}</span>
|
|
<span>{favoriteCount}</span>
|
|
|
</span>
|
|
</span>
|
|
|
)}
|
|
)}
|
|
@@ -293,7 +293,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
{showCreateTime && createTime && (
|
|
{showCreateTime && createTime && (
|
|
|
<div className='card-meta-right'>
|
|
<div className='card-meta-right'>
|
|
|
<span className='card-meta-item'>
|
|
<span className='card-meta-item'>
|
|
|
- <Calendar width="14" height="14" />
|
|
|
|
|
|
|
+ <Calendar size={14} />
|
|
|
<span>{createTime}</span>
|
|
<span>{createTime}</span>
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -306,13 +306,13 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
<div className='card-footer-info'>
|
|
<div className='card-footer-info'>
|
|
|
{certification && (
|
|
{certification && (
|
|
|
<div className='card-certification'>
|
|
<div className='card-certification'>
|
|
|
- <BadgeCheck width="14" height="14" />
|
|
|
|
|
|
|
+ <BadgeCheck size={14} />
|
|
|
<span>{certification}</span>
|
|
<span>{certification}</span>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
{showDepartment && department && (
|
|
{showDepartment && department && (
|
|
|
<div className='card-department'>
|
|
<div className='card-department'>
|
|
|
- <Building width="14" height="14" />
|
|
|
|
|
|
|
+ <Building size={14} />
|
|
|
<span>{department}</span>
|
|
<span>{department}</span>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -340,7 +340,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
>
|
|
>
|
|
|
<Button
|
|
<Button
|
|
|
className='card-operation-btn'
|
|
className='card-operation-btn'
|
|
|
- icon={<Menu width="18" height="18" />}
|
|
|
|
|
|
|
+ icon={<Menu size={18} />}
|
|
|
size='large'
|
|
size='large'
|
|
|
>
|
|
>
|
|
|
更多操作
|
|
更多操作
|
|
@@ -349,7 +349,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
) : (
|
|
) : (
|
|
|
<Button
|
|
<Button
|
|
|
className='card-operation-btn'
|
|
className='card-operation-btn'
|
|
|
- icon={<CodeBracketsSquare width="18" height="18" />}
|
|
|
|
|
|
|
+ icon={<Code size={18} />}
|
|
|
size='large'
|
|
size='large'
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
@@ -362,7 +362,7 @@ const AppCard: React.FC<AppCardProps> = (props) => {
|
|
|
|
|
|
|
|
<Button
|
|
<Button
|
|
|
className='card-use-btn'
|
|
className='card-use-btn'
|
|
|
- icon={<ArrowRight width="18" height="18" />}
|
|
|
|
|
|
|
+ icon={<ArrowRight size={18} />}
|
|
|
size='large'
|
|
size='large'
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|