Skip to content

Commit

Permalink
Reconfigured root page redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
codeaid committed May 27, 2024
1 parent e16bcd9 commit cd6efe2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
7 changes: 7 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ const nextConfig = {
},
output: 'export',
reactStrictMode: true,
redirects: async () => [
{
source: '/',
destination: '/fishes',
permanent: true,
}
],
swcMinify: true,
trailingSlash: false,
webpack(config) {
Expand Down
3 changes: 1 addition & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { Metadata } from 'next';
import { redirect } from 'next/navigation';

export const metadata: Metadata = {
title: 'Home - TackleBox',
};

const HomePage = () => redirect('/fishes');
const HomePage = () => null;

export default HomePage;
2 changes: 1 addition & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styles from './Header.module.css';

export const Header = () => (
<div className={styles.Header}>
<Link className={styles.HeaderLogo} href="/fishes">
<Link className={styles.HeaderLogo} href="/">
<Image alt="TackleBox logo" height={40} src={logoImg.src} width={184} />
</Link>

Expand Down
11 changes: 0 additions & 11 deletions src/components/NavigationRail/NavigationRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import clsx from 'clsx';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { FaHome } from 'react-icons/fa';
import { FaFishFins, FaRegMap } from 'react-icons/fa6';
import styles from './NavigationRail.module.css';

Expand All @@ -13,16 +12,6 @@ export const NavigationRail = () => {
return (
<div className={styles.NavigationRail}>
<ul className={styles.NavigationRailMenu}>
<li
className={clsx(styles.NavigationRailMenuItem, {
[styles.NavigationRailMenuItemActive]: pathname === '/',
})}
>
<Link className={styles.NavigationRailMenuItemLink} href="/">
<FaHome className={styles.NavigationRailMenuItemIcon} />
<div className={styles.NavigationRailMenuItemLabel}>Home</div>
</Link>
</li>
<li
className={clsx(styles.NavigationRailMenuItem, {
[styles.NavigationRailMenuItemActive]: pathname === '/fishes',
Expand Down

0 comments on commit cd6efe2

Please sign in to comment.