0f3b6c4cd8
- Remove dead code animations (animate-in, fade-in, slide-in, zoom-in, shake) from tailwindcss-animate plugin (not installed) - Remove decorative transition effects (transition-all, transition-colors) from all page components - Remove scale effects (active:scale-95) from buttons - Remove bounce animations (animate-bounce) from icons - Keep functional animate-spin on loading spinners as they provide essential loading feedback Affected pages: Dashboard, Timestamp, Jwt, JsonTools, Base64Converter, HtmlToMarkdown, MarkdownToHtml, QrCode, TextStatistics
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { useRouter } from '@/providers/RouterProvider';
|
|
import ToolCard from '@/pages/Dashboard/ToolCard';
|
|
import { getFeatureByKey } from '@/config/features';
|
|
import type { PageType } from '@/types/storage';
|
|
import { useMemo } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
export default function DashboardPage() {
|
|
const { navigateTo, visiblePages, pageOrder } = useRouter();
|
|
const { t } = useTranslation(['features']);
|
|
|
|
const visibleSet = useMemo(() => new Set<string>(visiblePages), [visiblePages]);
|
|
|
|
return (
|
|
<div
|
|
className={cn(
|
|
'grid grid-cols-1 sm:grid-cols-[repeat(auto-fill,minmax(290px,1fr))] auto-rows-auto gap-3.5 p-3.5 w-full h-auto',
|
|
'select-none',
|
|
)}
|
|
>
|
|
{pageOrder.map((key) => {
|
|
if (!visibleSet.has(key)) return null;
|
|
|
|
const feature = getFeatureByKey(key);
|
|
if (!feature?.themeColorKey || feature.icon == null) return null;
|
|
|
|
return (
|
|
<ToolCard
|
|
key={key}
|
|
title={t(feature.labelKey)}
|
|
description={t(feature.descriptionKey)}
|
|
colorKey={feature.themeColorKey}
|
|
icon={feature.icon}
|
|
onNavigate={() => navigateTo(key as PageType)}
|
|
/>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|