refactor(data): move data exports to index file
Consolidate data exports from data.ts to index.ts for better organization and maintainability. Remove the now redundant data.ts file.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { type AuthorCardProps } from '@/types';
|
||||
import { personalInfo } from '@/lib/data';
|
||||
import { personalInfo } from '@/lib/data/index';
|
||||
|
||||
export default function AuthorCard({ lang, author }: AuthorCardProps) {
|
||||
// Default author info based on personalInfo
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useTranslations } from "@/i18n/utils";
|
||||
import type { Lang } from "@/types/i18n";
|
||||
import { personalInfo } from "@/lib/data";
|
||||
import { personalInfo } from "@/lib/data/index";
|
||||
import { motion } from "framer-motion";
|
||||
import { useState, useEffect } from "react";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { personalInfo } from "@/lib/data";
|
||||
import { personalInfo } from "@/lib/data/index";
|
||||
import LanguageSwitcher from "./LanguageSwitcher";
|
||||
import ThemeToggle from "./ui/theme-toggle";
|
||||
import Container from "./ui/Container";
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
export { personalInfo } from './data/personal-info';
|
||||
export { projects } from './data/projects';
|
||||
export { services } from './data/services';
|
||||
|
||||
// export const projects = {
|
||||
// en: [{
|
||||
// id: "taskify",
|
||||
// tag: "business",
|
||||
// title: "Taskify App",
|
||||
// icon: "📱",
|
||||
// color: "purple",
|
||||
// image: {
|
||||
// bg: "from-purple-500/20 to-purple-600/20",
|
||||
// hover: "from-purple-500/20 to-purple-600/20",
|
||||
// text: "text-purple-400",
|
||||
// },
|
||||
// description: [
|
||||
// "A comprehensive task management application with drag-and-drop functionality.",
|
||||
// "Built with React, TypeScript, and Tailwind CSS using modern development approaches.",
|
||||
// "Real-time collaboration through WebSocket integration for instant updates.",
|
||||
// "Advanced task filtering, sorting, and project management capabilities.",
|
||||
// ],
|
||||
// tech: ["React", "Node.js", "MongoDB"],
|
||||
// link: "#",
|
||||
// },
|
||||
// ...
|
||||
// ],
|
||||
// zh: [...]
|
||||
// };
|
||||
//
|
||||
// export const services = {
|
||||
// en: [
|
||||
// {
|
||||
// title: "Outsourcing Projects",
|
||||
// icon: {...},
|
||||
// items: [...],
|
||||
// color: "blue",
|
||||
// },
|
||||
// ...
|
||||
// ],
|
||||
// zh: [...]
|
||||
// };
|
||||
@@ -8,7 +8,7 @@ import Container from "@/components/ui/Container";
|
||||
import { useTranslations } from "@/i18n/utils";
|
||||
import type { Lang } from "@/types/i18n";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
import { personalInfo, services } from "@/lib/data";
|
||||
import { personalInfo, services } from "@/lib/data/index";
|
||||
|
||||
// 使用Astro.currentLocale获取当前语言环境
|
||||
const lang = Astro.currentLocale as Lang || defaultLang;
|
||||
|
||||
@@ -3,9 +3,10 @@ import Layout from "@/layouts/Layout.astro";
|
||||
import GlassHeader from "@/components/GlassHeader";
|
||||
import Footer from "@/components/Footer";
|
||||
import Container from "@/components/ui/Container";
|
||||
import { useTranslations, type Lang } from "@/i18n/utils";
|
||||
import { useTranslations } from "@/i18n/utils";
|
||||
import type { Lang } from "@/types/i18n";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
import { projects } from "@/lib/data";
|
||||
import { projects } from "@/lib/data/index";
|
||||
|
||||
// 使用Astro.currentLocale获取当前语言环境
|
||||
const lang = Astro.currentLocale as Lang || defaultLang;
|
||||
|
||||
@@ -8,7 +8,7 @@ import Container from "@/components/ui/Container";
|
||||
import { useTranslations } from "@/i18n/utils";
|
||||
import type { Lang } from "@/types/i18n";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
import { personalInfo, services } from "@/lib/data";
|
||||
import { personalInfo, services } from "@/lib/data/index";
|
||||
|
||||
// 使用Astro.currentLocale获取当前语言环境
|
||||
const lang = Astro.currentLocale as Lang || defaultLang;
|
||||
|
||||
@@ -3,9 +3,10 @@ import Layout from "@/layouts/Layout.astro";
|
||||
import GlassHeader from "@/components/GlassHeader";
|
||||
import Footer from "@/components/Footer";
|
||||
import Container from "@/components/ui/Container";
|
||||
import { useTranslations, type Lang } from "@/i18n/utils";
|
||||
import { useTranslations } from "@/i18n/utils";
|
||||
import type { Lang } from "@/types/i18n";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
import { projects } from "@/lib/data";
|
||||
import { projects } from "@/lib/data/index";
|
||||
|
||||
// 使用Astro.currentLocale获取当前语言环境
|
||||
const lang = Astro.currentLocale as Lang || defaultLang;
|
||||
|
||||
Reference in New Issue
Block a user