mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: remove redundant Getting Started section from home page
The Getting Started section duplicated tools already shown in Popular. Now first-time users (no recents) go straight to Popular and Browse by Category.
This commit is contained in:
@@ -19,15 +19,6 @@ import { useSettingsStore } from "@/stores/settings-store";
|
|||||||
|
|
||||||
// ── Constants ────────────────────────────────────────────────────
|
// ── Constants ────────────────────────────────────────────────────
|
||||||
|
|
||||||
const GETTING_STARTED_IDS = [
|
|
||||||
"resize",
|
|
||||||
"compress",
|
|
||||||
"convert",
|
|
||||||
"crop",
|
|
||||||
"remove-background",
|
|
||||||
"merge-pdf",
|
|
||||||
];
|
|
||||||
|
|
||||||
const FALLBACK_POPULAR_IDS = [
|
const FALLBACK_POPULAR_IDS = [
|
||||||
"resize",
|
"resize",
|
||||||
"crop",
|
"crop",
|
||||||
@@ -354,8 +345,8 @@ function AllTabContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-10">
|
<div className="space-y-10">
|
||||||
{/* Recent or Getting Started */}
|
{/* Recent tools (only shown if user has history) */}
|
||||||
{recentTools.length > 0 ? (
|
{recentTools.length > 0 && (
|
||||||
<section>
|
<section>
|
||||||
<h2 className="text-sm font-semibold uppercase text-muted-foreground tracking-wider mb-3">
|
<h2 className="text-sm font-semibold uppercase text-muted-foreground tracking-wider mb-3">
|
||||||
{t.homePage.recent}
|
{t.homePage.recent}
|
||||||
@@ -372,8 +363,6 @@ function AllTabContent({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
) : (
|
|
||||||
<GettingStartedSection visibleTools={visibleTools} />
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Popular */}
|
{/* Popular */}
|
||||||
@@ -401,35 +390,6 @@ function AllTabContent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Getting Started (first-time user, no recents) ────────────────
|
|
||||||
|
|
||||||
function GettingStartedSection({ visibleTools }: { visibleTools: Tool[] }) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
const gettingStartedTools = useMemo(
|
|
||||||
() =>
|
|
||||||
GETTING_STARTED_IDS.map((id) => visibleTools.find((tool) => tool.id === id)).filter(
|
|
||||||
(tool): tool is Tool => tool != null,
|
|
||||||
),
|
|
||||||
[visibleTools],
|
|
||||||
);
|
|
||||||
|
|
||||||
if (gettingStartedTools.length === 0) return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section>
|
|
||||||
<h2 className="text-sm font-semibold uppercase text-muted-foreground tracking-wider mb-3">
|
|
||||||
{t.homePage.gettingStarted}
|
|
||||||
</h2>
|
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-1">
|
|
||||||
{gettingStartedTools.map((tool) => (
|
|
||||||
<ToolCard key={tool.id} tool={tool} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Browse by Category Grid ──────────────────────────────────────
|
// ── Browse by Category Grid ──────────────────────────────────────
|
||||||
|
|
||||||
const BROWSE_TABS: Array<{
|
const BROWSE_TABS: Array<{
|
||||||
|
|||||||
Reference in New Issue
Block a user