diff --git a/next.config.js b/next.config.js index 674802c..5c8c47a 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,7 @@ const path = require('path'); const withReactSvg = require('next-react-svg'); const withPlugins = require('next-compose-plugins'); +const { redirect } = require('next/dist/next-server/server/api-utils'); const withTM = require('next-transpile-modules')([ 'react-material-ui-carousel', ]); diff --git a/pages/index.tsx b/pages/index.tsx index baf84d1..070e2dd 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef } from 'react'; import { useTheme } from 'next-themes'; +import Router, { useRouter } from 'next/router'; import Head from 'next/head'; import Header from '../components/Header/Header'; @@ -18,6 +19,7 @@ import Features from '../components/ClvFeatures/CloverFeature'; declare var WOW; const Home = () => { + const router = useRouter(); const { theme, setTheme } = useTheme(); const scrollRef = useRef(null); const handleClickScroll = () => { @@ -26,9 +28,10 @@ const Home = () => { } }; useEffect(() => { - setTimeout(_ => { - // new WOW({ animateClass: 'animated' }).init(); - }, 1000); + const { asPath } = Router; + if (asPath !== '/') { + router.push(asPath); + } }, []); useEffect(() => { diff --git a/pages/sakura.tsx b/pages/sakura.tsx index 55c31be..84531d5 100644 --- a/pages/sakura.tsx +++ b/pages/sakura.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef } from 'react'; import { useTheme } from 'next-themes'; +import Router from 'next/router'; import Head from 'next/head'; import Header from '../components/Header/Header'; @@ -17,7 +18,7 @@ import { Introduction } from '../components/Introduction/Introduction'; import Features from '../components/ClvFeatures/CloverFeature'; declare var WOW; -const Home = () => { +const Sakura = () => { const { theme, setTheme } = useTheme(); const scrollRef = useRef(null); const handleClickScroll = () => { @@ -25,11 +26,6 @@ const Home = () => { scrollRef.current.scrollIntoView({ behavior: 'smooth' }); } }; - useEffect(() => { - setTimeout(_ => { - // new WOW({ animateClass: 'animated' }).init(); - }, 1000); - }, []); useEffect(() => { setTheme('dark'); @@ -68,4 +64,4 @@ const Home = () => { ); }; -export default Home; +export default Sakura;