Files
ittoview/src/pages/SettingsPage.tsx
2026-03-02 02:22:42 +00:00

107 lines
4.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { motion } from 'framer-motion'
import { Sun, Moon, Palette } from 'lucide-react'
import { useAppStore } from '@/stores/useAppStore'
export function SettingsPage() {
const { darkMode, setDarkMode } = useAppStore()
return (
<div className="space-y-6">
<div>
<h1 className="text-2xl font-bold text-gray-900 dark:text-white"></h1>
<p className="text-gray-500 dark:text-gray-400 mt-1">
使
</p>
</div>
{/* 主题设置 */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
className="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-100 dark:border-gray-700 overflow-hidden"
>
<div className="flex items-center gap-3 px-6 py-4 border-b border-gray-100 dark:border-gray-700">
<Palette size={20} className="text-indigo-600 dark:text-indigo-400" />
<h2 className="font-semibold text-gray-900 dark:text-white"></h2>
</div>
<div className="p-6">
<div className="mb-4">
<label className="text-sm font-medium text-gray-700 dark:text-gray-300">
</label>
<p className="text-sm text-gray-500 dark:text-gray-400 mt-1">
</p>
</div>
<div className="grid grid-cols-2 gap-4 max-w-xs">
{[
{ value: false, label: '浅色', icon: Sun },
{ value: true, label: '深色', icon: Moon },
].map((option) => {
const Icon = option.icon
const isSelected = darkMode === option.value
return (
<button
key={option.label}
onClick={() => setDarkMode(option.value)}
className={`flex flex-col items-center gap-2 p-4 rounded-lg border-2 transition-all ${
isSelected
? 'border-indigo-500 bg-indigo-50 dark:bg-indigo-900/30'
: 'border-gray-200 dark:border-gray-600 hover:border-gray-300 dark:hover:border-gray-500'
}`}
>
<Icon
size={24}
className={isSelected ? 'text-indigo-600 dark:text-indigo-400' : 'text-gray-500'}
/>
<span
className={`text-sm font-medium ${
isSelected ? 'text-indigo-600 dark:text-indigo-400' : 'text-gray-700 dark:text-gray-300'
}`}
>
{option.label}
</span>
</button>
)
})}
</div>
</div>
</motion.div>
{/* 联系方式 */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.1 }}
className="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-100 dark:border-gray-700 p-6"
>
<h2 className="font-semibold text-gray-900 dark:text-white mb-4"></h2>
<div className="flex flex-col items-center gap-3">
<img
src="/wechat-qrcode.jpg"
alt="微信二维码"
className="w-48 rounded-lg border border-gray-200 dark:border-gray-600"
/>
<p className="text-sm text-gray-500 dark:text-gray-400">
</p>
</div>
</motion.div>
{/* 关于 */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.2 }}
className="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-100 dark:border-gray-700 p-6"
>
<h2 className="font-semibold text-gray-900 dark:text-white mb-4"> ITTOView</h2>
<div className="space-y-2 text-sm text-gray-500 dark:text-gray-400">
<p>1.0.0</p>
<p> 49 ITTO </p>
</div>
</motion.div>
</div>
)
}