Skip to content

Commit a0c068b

Browse files
committed
f
1 parent cadd242 commit a0c068b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

web/app/components/LocaleLink.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// LocaleLink.tsx
22
import { Link, useParams } from "@remix-run/react";
33

4-
54
export function LocaleLink({
65
to,
76
children,
@@ -11,7 +10,7 @@ export function LocaleLink({
1110
children: React.ReactNode;
1211
className?: string;
1312
}) {
14-
const { locale } = useParams();
13+
const { locale } = useParams();
1514

1615
const path = `/${locale}${to}`;
1716

web/app/components/NavLocaleLink.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { NavLink, type NavLinkProps, useParams } from "@remix-run/react";
22

3-
43
// NavLinkProps を継承
54
type NavLocaleLinkProps = Omit<NavLinkProps, "to"> & {
65
to: string;
@@ -12,17 +11,13 @@ export function NavLocaleLink({
1211
children,
1312
...rest
1413
}: NavLocaleLinkProps) {
15-
const { locale } = useParams();
14+
const { locale } = useParams();
1615

1716
const normalized = to.startsWith("/") ? to.slice(1) : to;
1817
const path = `/${locale}/${normalized}`;
1918

2019
return (
21-
<NavLink
22-
to={path}
23-
className={className}
24-
{...rest}
25-
>
20+
<NavLink to={path} className={className} {...rest}>
2621
{children}
2722
</NavLink>
2823
);

0 commit comments

Comments
 (0)