Skip to content

Commit

Permalink
Minor fix (#124)
Browse files Browse the repository at this point in the history
* minor fix

* allow function

* yarn upgrade
  • Loading branch information
katayama8000 authored Mar 27, 2024
1 parent 5421298 commit ff90285
Show file tree
Hide file tree
Showing 3 changed files with 438 additions and 398 deletions.
8 changes: 2 additions & 6 deletions src/components/layout/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ type Props = {
};

export const Title: FC<Props> = ({ title, description, url, pageUrl }) => {
const router = useRouter();
const { push } = useRouter();
const handleLinkClick = () => {
if (url) {
window.open(url);
} else if (pageUrl) {
router.push(pageUrl);
}
url ? window.open(url) : pageUrl ? push(pageUrl) : null;
};
return (
<article className='py-4'>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useRouter } from 'next/router';
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';

function MyApp({ Component, pageProps }: AppProps) {
const MyApp = ({ Component, pageProps }: AppProps) => {
const { pathname } = useRouter();
return (
<>
Expand All @@ -30,6 +30,6 @@ function MyApp({ Component, pageProps }: AppProps) {
)}
</>
);
}
};

export default MyApp;
Loading

1 comment on commit ff90285

@vercel
Copy link

@vercel vercel bot commented on ff90285 Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.