refactor(profile): centralize personal info in data module and update components
Move all personal information to a centralized data module and update components to use this source. This improves maintainability by having a single source of truth for profile data and makes it easier to update information across the application.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Lang } from '../i18n/utils';
|
||||
import { personalInfo } from '@/lib/data';
|
||||
|
||||
interface AuthorCardProps {
|
||||
lang: Lang;
|
||||
@@ -14,17 +15,17 @@ interface AuthorCardProps {
|
||||
}
|
||||
|
||||
export default function AuthorCard({ lang, author }: AuthorCardProps) {
|
||||
// Default author info
|
||||
// Default author info based on personalInfo
|
||||
const defaultAuthor = {
|
||||
name: 'Zhao Guiyang',
|
||||
name: personalInfo.name,
|
||||
bio: lang === 'zh'
|
||||
? '全栈开发者,专注于现代Web技术和用户体验设计。热爱分享技术见解和最佳实践。'
|
||||
: 'Full-stack developer passionate about modern web technologies and user experience design. Love sharing technical insights and best practices.',
|
||||
avatar: 'https://avatars.githubusercontent.com/u/24975063?v=4', // You can replace with actual avatar
|
||||
website: 'https://zhaoguiyang.com',
|
||||
github: 'https://github.com/zhaoguiyang',
|
||||
twitter: 'https://twitter.com/zhaoguiyang',
|
||||
linkedin: 'https://linkedin.com/in/zhaoguiyang'
|
||||
? personalInfo.description.zh
|
||||
: personalInfo.description.en,
|
||||
avatar: personalInfo.avatar,
|
||||
website: personalInfo.website || 'https://zhaoguiyang.com',
|
||||
github: personalInfo.github,
|
||||
twitter: personalInfo.twitter || 'https://twitter.com/zhaoguiyang',
|
||||
linkedin: personalInfo.linkedin
|
||||
};
|
||||
|
||||
const authorInfo = author || defaultAuthor;
|
||||
|
||||
Reference in New Issue
Block a user