mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-10 03:27:54 +00:00
feat: refine skill detail author badge and landing publish CTA (#95)
* Replace skill author monogram with icon * Update landing publish CTA copy
This commit is contained in:
parent
2daddab217
commit
c90199183a
2 changed files with 3 additions and 16 deletions
|
|
@ -16,7 +16,7 @@
|
|||
"subtitle": "使用社区驱动的技能构建强大的 AI 代理",
|
||||
"searchPlaceholder": "搜索技能...",
|
||||
"exploreSkills": "探索技能",
|
||||
"publishSkill": "开始构建"
|
||||
"publishSkill": "发布技能"
|
||||
},
|
||||
"features": {
|
||||
"secure": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react'
|
|||
import { useTranslation } from 'react-i18next'
|
||||
import { useParams, useNavigate, useRouterState, useSearch } from '@tanstack/react-router'
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { ArrowLeft, ChevronDown, ChevronUp } from 'lucide-react'
|
||||
import { ArrowLeft, ChevronDown, ChevronUp, User } from 'lucide-react'
|
||||
import { MarkdownRenderer } from '@/features/skill/markdown-renderer'
|
||||
import { FileTree } from '@/features/skill/file-tree'
|
||||
import { InstallCommand } from '@/features/skill/install-command'
|
||||
|
|
@ -68,19 +68,6 @@ function parseMetadataJson(parsed?: string) {
|
|||
}
|
||||
}
|
||||
|
||||
function getAuthorMonogram(name?: string) {
|
||||
if (!name) {
|
||||
return '?'
|
||||
}
|
||||
|
||||
const trimmed = name.trim()
|
||||
if (!trimmed) {
|
||||
return '?'
|
||||
}
|
||||
|
||||
return trimmed[0]!.toUpperCase()
|
||||
}
|
||||
|
||||
function getPromotionConflictKey(error: ApiError): 'promotion.duplicate_pending' | 'promotion.already_promoted' | null {
|
||||
if (error.serverMessageKey === 'promotion.duplicate_pending') {
|
||||
return 'promotion.duplicate_pending'
|
||||
|
|
@ -565,7 +552,7 @@ export function SkillDetailPage() {
|
|||
<div className="flex min-w-0">
|
||||
<div className="inline-flex max-w-full items-center gap-2 rounded-full border border-border/60 bg-background/85 px-3 py-1.5 text-sm text-muted-foreground shadow-sm backdrop-blur-sm">
|
||||
<span className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[11px] font-semibold uppercase tracking-[0.08em] text-primary">
|
||||
{getAuthorMonogram(skill.ownerDisplayName)}
|
||||
<User className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
<span className="min-w-0 truncate">{t('skillDetail.authorLabel', { name: skill.ownerDisplayName })}</span>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue