Skip to content

Commit

Permalink
update: Use forked next-view-transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Jul 8, 2024
1 parent ef2da6c commit af8094c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"newpost": "pnpm run blogtool newpost"
},
"dependencies": {
"@hayao/next-view-transitions": "0.2.1",
"clsx": "^2.1.1",
"framer-motion": "^11.2.10",
"gray-matter": "^4.0.3",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "@/style/global.css";
import "@/style/prism.css";

import { ViewTransitions } from "@hayao/next-view-transitions";
import { Metadata as NextMetadata } from "next";
import React, { ReactNode, Suspense } from "react";

Expand All @@ -18,9 +19,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
</Suspense>
</head>
<body className="overflow-x-hidden overscroll-y-none">
{/* ページ内リンクで正常に動作しない */}
{/*<ViewTransitions>{children}</ViewTransitions>*/}
{children}
<ViewTransitions>{children}</ViewTransitions>
</body>
</html>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/elements/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { Link as ViewTransitionLink } from "@hayao/next-view-transitions";
import classNames from "clsx";
import { motion } from "framer-motion";
import { default as NextLink } from "next/link";
Expand All @@ -15,7 +16,7 @@ export default function DaisyLink(props: NextLinkProps) {
}

export const Link = (props: NextLinkProps) => {
return <NextLink {...props} />;
return <ViewTransitionLink {...props} />;
};

export function AnimatedLink(props: NextLinkProps) {
Expand Down

0 comments on commit af8094c

Please sign in to comment.