refactor(ui): simplify empty state components and remove unused blog posts
- Replace custom SVG icons with lucide-react components in TaxonomyPageLayout, CategoryCard, and TagCard - Remove unnecessary "Back to blog list" links from empty states - Delete outdated blog posts about React Hooks, Docker, Tailwind CSS, and TypeScript
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
---
|
||||
import { Tag } from 'lucide-react';
|
||||
import { type Lang } from '@/i18n/utils';
|
||||
import { defaultLang } from '@/i18n/ui';
|
||||
import { getBlogBaseUrl, extractCategories } from '@/utils/blog-utils';
|
||||
@@ -42,9 +43,7 @@ const title = titles[lang] || titles[defaultLang];
|
||||
|
||||
<div class="bg-card/50 backdrop-blur-sm rounded-2xl p-6 border border-border">
|
||||
<h3 class="text-xl font-semibold text-card-foreground mb-4 flex items-center">
|
||||
<svg class="w-5 h-5 mr-2 text-purple-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14-7l2 2-2 2m2-2H9m10 0V9M5 19l2-2-2-2m2 2H3m2 0v2"></path>
|
||||
</svg>
|
||||
<Tag className="w-5 h-5 mr-2 text-purple-500" />
|
||||
{title}
|
||||
</h3>
|
||||
<div class="space-y-2">
|
||||
@@ -59,17 +58,8 @@ const title = titles[lang] || titles[defaultLang];
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<div class="flex flex-col items-center justify-center py-6 space-y-4">
|
||||
<svg class="w-12 h-12 text-purple-500/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 11H5m14-7l2 2-2 2m2-2H9m10 0V9M5 19l2-2-2-2m2 2H3m2 0v2"></path>
|
||||
</svg>
|
||||
<div class="flex flex-col items-center justify-center py-6">
|
||||
<p class="text-muted-foreground text-center">{lang === 'zh' ? '暂无分类' : 'No categories yet'}</p>
|
||||
<a href={baseUrl} class="inline-flex items-center px-4 py-2 rounded-full text-sm font-medium bg-purple-500 text-white shadow-sm hover:bg-purple-600 transition-all duration-200 hover:shadow-md">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
|
||||
</svg>
|
||||
{lang === 'zh' ? '返回博客列表' : 'Back to blog list'}
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
import { Hash } from 'lucide-react';
|
||||
import { type Lang } from '@/i18n/utils';
|
||||
import { defaultLang } from '@/i18n/ui';
|
||||
import { getBlogBaseUrl, extractTags } from '@/utils/blog-utils';
|
||||
@@ -32,8 +33,8 @@ const tags = Array.from(tagMap.keys()).map(tag => `# ${tag}`).sort();
|
||||
|
||||
// Multilingual titles
|
||||
const titles = {
|
||||
en: '# Tags',
|
||||
zh: '# 标签'
|
||||
en: 'Tags',
|
||||
zh: '标签'
|
||||
};
|
||||
|
||||
// Get title for current language
|
||||
@@ -42,9 +43,7 @@ const title = titles[lang] || titles[defaultLang];
|
||||
|
||||
<div class="bg-card/50 backdrop-blur-sm rounded-2xl p-6 border border-border">
|
||||
<h3 class="text-xl font-semibold text-card-foreground mb-4 flex items-center">
|
||||
<svg class="w-5 h-5 mr-2 text-purple-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
|
||||
</svg>
|
||||
<Hash className='w-5 h-5 mr-2 text-purple-500' />
|
||||
{title}
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@@ -61,17 +60,8 @@ const title = titles[lang] || titles[defaultLang];
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<div class="flex flex-col items-center justify-center py-6 space-y-4 w-full">
|
||||
<svg class="w-12 h-12 text-purple-500/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
|
||||
</svg>
|
||||
<div class="flex flex-col items-center justify-center py-6 w-full">
|
||||
<p class="text-muted-foreground text-center">{lang === 'zh' ? '暂无标签' : 'No tags yet'}</p>
|
||||
<a href={baseUrl} class="inline-flex items-center px-4 py-2 rounded-full text-sm font-medium bg-purple-500 text-white shadow-sm hover:bg-purple-600 transition-all duration-200 hover:shadow-md">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
|
||||
</svg>
|
||||
{lang === 'zh' ? '返回博客列表' : 'Back to blog list'}
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user