Skip to content

Commit

Permalink
Add redirect from root to kc-development-tools and integrate Navigati…
Browse files Browse the repository at this point in the history
…on component in Home page
  • Loading branch information
SkywalkerJi committed Dec 26, 2024
1 parent 4735799 commit 4d1b36b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
19 changes: 4 additions & 15 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,18 @@

import { useState } from 'react';
import Link from 'next/link';
import { Language, getTranslation } from '../utils/i18n';
import { Language } from '../types/lottery';
import { getTranslation } from '../utils/i18n';
import Navigation from '../components/Navigation';

export default function Home() {
const [language, setLanguage] = useState<Language>('zh_cn');
const t = getTranslation(language);

return (
<main className="min-h-screen p-8 bg-gray-50 dark:bg-gray-900">
<Navigation language={language} onLanguageChange={setLanguage} />
<div className="max-w-4xl mx-auto space-y-12">
{/* 语言选择 */}
<div className="flex justify-end">
<select
value={language}
onChange={(e) => setLanguage(e.target.value as Language)}
className="p-2 border rounded dark:bg-gray-700 dark:text-gray-100 dark:border-gray-600"
>
<option value="ja_jp">日本語</option>
<option value="zh_cn">简体中文</option>
<option value="zh_tw">繁體中文</option>
<option value="en_us">English</option>
</select>
</div>

{/* 标题 */}
<div className="text-center">
<h1 className="text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">
Expand Down
10 changes: 10 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ const nextConfig = {
images: {
unoptimized: true,
},
async redirects() {
return [
{
source: '/',
destination: '/kc-development-tools',
permanent: true,
basePath: false
}
];
}
}

export default nextConfig;

0 comments on commit 4d1b36b

Please sign in to comment.