fix: lang page url push

This commit is contained in:
JOYCEQL
2025-01-10 14:46:35 +08:00
committed by qingchen
parent 92144089f4
commit d799f1bcba
6 changed files with 22 additions and 20 deletions
@@ -6,6 +6,7 @@ import Header from "@/components/home/Header";
import FeaturesAnimation from "@/components/home/FeaturesAnimation";
import HeroAnimation from "@/components/home/HeroAnimation";
import { setRequestLocale } from "next-intl/server";
import GoDashboard from "@/components/home/GoDashboard";
type Props = {
params: { locale: string };
@@ -29,14 +30,15 @@ export default function LandingPage({ params: { locale } }: Props) {
{t("hero.subtitle")}
</p>
<div className="mt-12">
<Link href="/dashboard">
<GoDashboard>
<Button
size="lg"
type="submit"
className="rounded-full px-10 py-6 text-lg font-semibold shadow-lg hover:shadow-xl transition-all duration-300"
>
{t("hero.cta")}
</Button>
</Link>
</GoDashboard>
</div>
</HeroAnimation>
@@ -131,7 +131,7 @@ const ResumeWorkbench = () => {
size="sm"
className="ml-4"
onClick={() => {
router.push("/dashboard/settings");
router.push("/app/dashboard/settings");
}}
>
<Settings className="w-4 h-4 mr-2" />
+1 -1
View File
@@ -136,7 +136,7 @@ const Field = ({
<span> ApiKey Id</span>
<Button
className="p-0 h-auto text-white"
onClick={() => router.push("/dashboard/settings")}
onClick={() => router.push("/app/dashboard/settings")}
>
</Button>
@@ -1,18 +1,10 @@
import { useTranslations } from "next-intl";
import { Button } from "../ui/button";
import { GoDashboardAction } from "@/actions/navigation";
export default function GoDashboard() {
const t = useTranslations("home");
return (
<form action={GoDashboardAction}>
<Button
variant="default"
className="bg-primary hover:opacity-90 text-white h-8 text-sm rounded-full px-4"
>
{t("header.startButton")}
</Button>
</form>
);
export default function GoDashboard({
children,
}: {
children: React.ReactNode;
}) {
return <form action={GoDashboardAction}>{children}</form>;
}
+9 -1
View File
@@ -8,6 +8,7 @@ import ThemeToggle from "@/components/shared/ThemeToggle";
import GitHubStars from "@/components/shared/GitHubStars";
import LanguageSwitch from "../shared/LanguageSwitch";
import GoDashboard from "./GoDashboard";
import { Button } from "../ui/button";
export default function Header() {
const [mounted, setMounted] = useState(false);
@@ -77,7 +78,14 @@ export default function Header() {
</div>
</ThemeToggle>
<GitHubStars />
<GoDashboard />
<GoDashboard>
<Button
type="submit"
className="bg-primary hover:opacity-90 text-white h-8 text-sm rounded-full px-4"
>
{t("header.startButton")}
</Button>
</GoDashboard>
</div>
</div>
</div>
@@ -64,7 +64,7 @@ export const PreviewDock = ({
<span>{t("grammarCheck.configurePrompt")}</span>
<Button
className="p-0 h-auto text-white"
onClick={() => router.push("/dashboard/settings")}
onClick={() => router.push("/app/dashboard/settings")}
>
{t("grammarCheck.configureButton")}
</Button>