fixing url issues with renaming
This commit is contained in:
@@ -163,7 +163,7 @@ export default function CategoryPage() {
|
|||||||
...prev,
|
...prev,
|
||||||
[categoryId]: partId,
|
[categoryId]: partId,
|
||||||
}));
|
}));
|
||||||
router.push("/gunbuilder");
|
router.push("/builder");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ export default function CategoryPage() {
|
|||||||
Category Not Found
|
Category Not Found
|
||||||
</h1>
|
</h1>
|
||||||
<Link
|
<Link
|
||||||
href="/gunbuilder"
|
href="/builder"
|
||||||
className="text-amber-300 hover:text-amber-200 underline"
|
className="text-amber-300 hover:text-amber-200 underline"
|
||||||
>
|
>
|
||||||
Return to Gunbuilder
|
Return to Gunbuilder
|
||||||
@@ -326,7 +326,7 @@ export default function CategoryPage() {
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<header className="mb-6">
|
<header className="mb-6">
|
||||||
<Link
|
<Link
|
||||||
href="/gunbuilder"
|
href="/builder"
|
||||||
className="text-xs text-zinc-400 hover:text-zinc-300 mb-4 inline-block"
|
className="text-xs text-zinc-400 hover:text-zinc-300 mb-4 inline-block"
|
||||||
>
|
>
|
||||||
← Back to The Armory
|
← Back to The Armory
|
||||||
@@ -670,7 +670,7 @@ export default function CategoryPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-2 flex gap-2">
|
<div className="mt-2 flex gap-2">
|
||||||
<Link
|
<Link
|
||||||
href={`/gunbuilder/${categoryId}/${part.id}`}
|
href={`/builder/${categoryId}/${part.id}`}
|
||||||
className="flex-1 rounded-md border border-zinc-700 bg-zinc-800/50 px-3 py-2 text-center text-xs font-medium text-zinc-300 transition-colors hover:border-zinc-600 hover:bg-zinc-700"
|
className="flex-1 rounded-md border border-zinc-700 bg-zinc-800/50 px-3 py-2 text-center text-xs font-medium text-zinc-300 transition-colors hover:border-zinc-600 hover:bg-zinc-700"
|
||||||
>
|
>
|
||||||
View Details
|
View Details
|
||||||
@@ -733,7 +733,7 @@ export default function CategoryPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex justify-end gap-2">
|
<div className="flex justify-end gap-2">
|
||||||
<Link
|
<Link
|
||||||
href={`/gunbuilder/${categoryId}/${part.id}`}
|
href={`/builder/${categoryId}/${part.id}`}
|
||||||
className="whitespace-nowrap rounded-md border border-zinc-700 bg-zinc-800/50 px-3 py-1.5 text-xs font-medium text-zinc-300 transition-colors hover:border-zinc-600 hover:bg-zinc-700"
|
className="whitespace-nowrap rounded-md border border-zinc-700 bg-zinc-800/50 px-3 py-1.5 text-xs font-medium text-zinc-300 transition-colors hover:border-zinc-600 hover:bg-zinc-700"
|
||||||
>
|
>
|
||||||
View Details
|
View Details
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ export default function GunbuilderPage() {
|
|||||||
return updated;
|
return updated;
|
||||||
});
|
});
|
||||||
|
|
||||||
router.replace("/gunbuilder", { scroll: false });
|
router.replace("/builder", { scroll: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [searchParams, router]);
|
}, [searchParams, router]);
|
||||||
@@ -223,7 +223,7 @@ export default function GunbuilderPage() {
|
|||||||
const payload = JSON.stringify(build);
|
const payload = JSON.stringify(build);
|
||||||
const encoded = window.btoa(payload);
|
const encoded = window.btoa(payload);
|
||||||
const origin = window.location?.origin ?? "";
|
const origin = window.location?.origin ?? "";
|
||||||
const url = `${origin}/gunbuilder/build?build=${encodeURIComponent(
|
const url = `${origin}/builder/build?build=${encodeURIComponent(
|
||||||
encoded,
|
encoded,
|
||||||
)}`;
|
)}`;
|
||||||
setShareUrl(url);
|
setShareUrl(url);
|
||||||
@@ -338,10 +338,10 @@ export default function GunbuilderPage() {
|
|||||||
<header className="mb-6">
|
<header className="mb-6">
|
||||||
<div>
|
<div>
|
||||||
<p className="text-xs font-semibold tracking-[0.2em] uppercase text-zinc-500">
|
<p className="text-xs font-semibold tracking-[0.2em] uppercase text-zinc-500">
|
||||||
Shadow Standard Co.
|
BATTL BUILDERS
|
||||||
</p>
|
</p>
|
||||||
<h1 className="mt-1 text-2xl md:text-3xl font-semibold tracking-tight">
|
<h1 className="mt-1 text-2xl md:text-3xl font-semibold tracking-tight">
|
||||||
The Build Bench: <span className="text-amber-300">Early Access</span>
|
BattlBuilder <span className="text-amber-300">Early Access</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p className="mt-2 text-sm text-zinc-400 max-w-xl">
|
<p className="mt-2 text-sm text-zinc-400 max-w-xl">
|
||||||
Explore components from trusted brands, choose one part per
|
Explore components from trusted brands, choose one part per
|
||||||
@@ -372,7 +372,7 @@ export default function GunbuilderPage() {
|
|||||||
{/* Primary actions now live under the total */}
|
{/* Primary actions now live under the total */}
|
||||||
<div className="mt-2 flex flex-col items-stretch gap-2 sm:flex-row sm:flex-wrap">
|
<div className="mt-2 flex flex-col items-stretch gap-2 sm:flex-row sm:flex-wrap">
|
||||||
<Link
|
<Link
|
||||||
href="/gunbuilder/build"
|
href="/builder/build"
|
||||||
className={`w-full sm:w-auto rounded-md border border-amber-400/60 bg-amber-400/10 px-3 py-2 text-sm font-medium text-amber-200 hover:bg-amber-400/15 text-center transition-colors ${
|
className={`w-full sm:w-auto rounded-md border border-amber-400/60 bg-amber-400/10 px-3 py-2 text-sm font-medium text-amber-200 hover:bg-amber-400/15 text-center transition-colors ${
|
||||||
selectedParts.length === 0
|
selectedParts.length === 0
|
||||||
? "opacity-40 cursor-not-allowed pointer-events-none"
|
? "opacity-40 cursor-not-allowed pointer-events-none"
|
||||||
@@ -598,7 +598,7 @@ export default function GunbuilderPage() {
|
|||||||
{selectedPart && selectedPart.url ? (
|
{selectedPart && selectedPart.url ? (
|
||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
href={`/gunbuilder/${category.id}`}
|
href={`/builder/${category.id}`}
|
||||||
className="hidden md:inline-flex items-center justify-center rounded-md border border-zinc-700 bg-zinc-900/70 px-2 py-1 hover:bg-zinc-800 hover:border-zinc-600 transition-colors"
|
className="hidden md:inline-flex items-center justify-center rounded-md border border-zinc-700 bg-zinc-900/70 px-2 py-1 hover:bg-zinc-800 hover:border-zinc-600 transition-colors"
|
||||||
aria-label="Change part"
|
aria-label="Change part"
|
||||||
title="Change part"
|
title="Change part"
|
||||||
@@ -618,7 +618,7 @@ export default function GunbuilderPage() {
|
|||||||
</>
|
</>
|
||||||
) : hasParts ? (
|
) : hasParts ? (
|
||||||
<Link
|
<Link
|
||||||
href={`/gunbuilder/${category.id}`}
|
href={`/builder/${category.id}`}
|
||||||
className="inline-flex rounded-md border border-zinc-700 bg-zinc-900/70 px-2.5 py-1 text-[0.7rem] font-medium text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors"
|
className="inline-flex rounded-md border border-zinc-700 bg-zinc-900/70 px-2.5 py-1 text-[0.7rem] font-medium text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// If you want to pre-select something later, you can handle here.
|
// If you want to pre-select something later, you can handle here.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function BuilderNav({ activeCategoryId }: BuilderNavProps) {
|
|||||||
const currentCategory =
|
const currentCategory =
|
||||||
activeCategoryId ?? searchParams.get("category") ?? undefined;
|
activeCategoryId ?? searchParams.get("category") ?? undefined;
|
||||||
|
|
||||||
const baseHref = "/gunbuilder";
|
const baseHref = "/builder";
|
||||||
|
|
||||||
const renderDropdown = (label: string, items: Category[]) => {
|
const renderDropdown = (label: string, items: Category[]) => {
|
||||||
if (!items.length) return null;
|
if (!items.length) return null;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function CategoryColumn({
|
|||||||
<div className="w-full border border-zinc-700 rounded-md p-3 mb-2 flex items-center justify-between gap-3">
|
<div className="w-full border border-zinc-700 rounded-md p-3 mb-2 flex items-center justify-between gap-3">
|
||||||
<p className="text-sm text-zinc-500">No part selected</p>
|
<p className="text-sm text-zinc-500">No part selected</p>
|
||||||
<Link
|
<Link
|
||||||
href={`/gunbuilder/${category.id}`}
|
href={`/builder/${category.id}`}
|
||||||
className="inline-flex items-center gap-2 rounded-md border border-zinc-700 bg-zinc-900/60 px-3 py-1.5 text-xs font-medium text-zinc-200 hover:bg-zinc-800 hover:border-zinc-500 transition-colors"
|
className="inline-flex items-center gap-2 rounded-md border border-zinc-700 bg-zinc-900/60 px-3 py-1.5 text-xs font-medium text-zinc-200 hover:bg-zinc-800 hover:border-zinc-500 transition-colors"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -68,7 +68,7 @@ export function CategoryColumn({
|
|||||||
</div>
|
</div>
|
||||||
{parts.length >= 1 && (
|
{parts.length >= 1 && (
|
||||||
<Link
|
<Link
|
||||||
href={`/gunbuilder/${category.id}`}
|
href={`/builder/${category.id}`}
|
||||||
className="mt-2 w-full rounded-md border border-zinc-700 bg-zinc-900/50 px-3 py-2 text-xs font-medium text-zinc-300 hover:bg-zinc-800 hover:border-zinc-600 transition-colors text-center"
|
className="mt-2 w-full rounded-md border border-zinc-700 bg-zinc-900/50 px-3 py-2 text-xs font-medium text-zinc-300 hover:bg-zinc-800 hover:border-zinc-600 transition-colors text-center"
|
||||||
>
|
>
|
||||||
View All ({parts.length})
|
View All ({parts.length})
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export function TopNav() {
|
|||||||
{/* Center: main nav (Builder / Admin) */}
|
{/* Center: main nav (Builder / Admin) */}
|
||||||
<nav className="hidden items-center gap-4 md:flex">
|
<nav className="hidden items-center gap-4 md:flex">
|
||||||
<Link
|
<Link
|
||||||
href="/gunbuilder"
|
href="/builder"
|
||||||
className="text-xs font-medium text-zinc-300 hover:text-zinc-50 transition-colors"
|
className="text-xs font-medium text-zinc-300 hover:text-zinc-50 transition-colors"
|
||||||
>
|
>
|
||||||
Builder
|
Builder
|
||||||
|
|||||||
Reference in New Issue
Block a user