diff --git a/src/components/header.tsx b/src/components/header.tsx
index a89eecd..d4022ea 100644
--- a/src/components/header.tsx
+++ b/src/components/header.tsx
@@ -74,8 +74,8 @@ function Header({ showMenu = false }: HeaderProps) {
const scrollToSection = (sectionId: string) => {
const targetId = sectionId.replace('#', '');
- const isOnMainPage = location.pathname === '/';
- const element = isOnMainPage ? document.getElementById(targetId) : null;
+ const isOn40PlusPage = location.pathname === '/40+';
+ const element = isOn40PlusPage ? document.getElementById(targetId) : null;
if (element) {
// Close drawer first, then scroll after animation completes
@@ -96,8 +96,8 @@ function Header({ showMenu = false }: HeaderProps) {
window.dispatchEvent(new CustomEvent('pending-scroll-section'));
}
- if (!isOnMainPage) {
- router.navigate({ to: '/' });
+ if (!isOn40PlusPage) {
+ router.navigate({ to: '/40+' });
}
};
@@ -128,7 +128,7 @@ function Header({ showMenu = false }: HeaderProps) {
const handleMenuClick = (itemId: string) => {
if (itemId === 'recipes') {
- const isOnRecipePage = location.pathname === '/recipe';
+ const isOnRecipePage = location.pathname === '/40+/recipe';
if (isOnRecipePage) {
// Already on recipe page, just close drawer
@@ -136,8 +136,8 @@ function Header({ showMenu = false }: HeaderProps) {
return;
}
- // Navigate from main page - force reload to ensure Instagram embeds work
- window.location.href = '/recipe';
+ // Navigate to recipe page - force reload to ensure Instagram embeds work
+ window.location.href = '/40+/recipe';
return;
} else {
// Scroll to section (drawer will be closed inside scrollToSection)
diff --git a/src/components/layout.tsx b/src/components/layout.tsx
index 7b8bb96..3f9e86d 100644
--- a/src/components/layout.tsx
+++ b/src/components/layout.tsx
@@ -1,4 +1,4 @@
-import { Outlet } from '@tanstack/react-router'
+import { Outlet, useRouterState } from '@tanstack/react-router'
import {
Box,
Container,
@@ -6,17 +6,23 @@ import {
import Footer from './footer'
+import OldFooter from './oldFooter'
function Layout() {
+ const { location } = useRouterState()
+
+ // Use oldFooter for main page (/), footer for /40+ pages
+ const isMainPage = location.pathname === '/'
+
return (
{/* */}
-
+ {isMainPage ? : }
)
}
diff --git a/src/components/new_ui/advantages.tsx b/src/components/new_ui/advantages.tsx
index 26f4cc8..32f5c4b 100644
--- a/src/components/new_ui/advantages.tsx
+++ b/src/components/new_ui/advantages.tsx
@@ -213,7 +213,7 @@ function Advantages() {
columns={{ base: 1, sm: 1, md: 1 }}
p={4}
pb={10}
- mt = {20}
+ mt={20}
w={{ base: '100%', sm: '95vw', md: '90vw', lg: '85vw', xl: '65vw' }}
h={'auto'}
mx="auto"
@@ -333,7 +333,7 @@ function Advantages() {
fontSize={{ md: "1vw", lg: "1.0vw", xl: "0.8vw" }}
mt={-1}
>
- {item.text}
+ {renderCubeDescription(item.text)}
))}
@@ -455,7 +455,7 @@ function Advantages() {
{
+ return text.split('\n').map((line, i) => (
+
+ {line.charAt(0).match(/[\*\^\▲\+\▼\#]/) ? (
+ <>
+ {line.charAt(0)}
+ {line.substring(1).split('\t').map((segment, j) => (
+ j === 0 ? segment : {segment}
+ ))}
+ >
+ ) : (
+ line.split('\t').map((segment, j) => (
+ j === 0 ? segment : {segment}
+ ))
+ )}
+ {i < text.split('\n').length - 1 &&
}
+
+ ));
+ };
+ const currentYear = new Date().getFullYear();
+ return (
+
+
+ {"查詢:29437810"}
+
+
+
+
+
+
+
+
+ {formatText(footerText)}
+
+ {`Copyright © ${currentYear}合興食油(香港)有限公司 版權所有,不得轉載。`}
+
+ {/*
+ {`參考資料 | 台灣營養師張益堯在節目《奕起聊健康》上分享關於「油脂」的健康 https://bit.ly/3FmZkCo https://bit.ly/4htQ9gt`}
+ */}
+
+
+
+ );
+}
+
+export default OldFooter;
\ No newline at end of file
diff --git a/src/pages/main.tsx b/src/pages/main.tsx
index 464cbbf..2478e62 100644
--- a/src/pages/main.tsx
+++ b/src/pages/main.tsx
@@ -17,7 +17,7 @@ function MainPage() {
const { location } = useRouterState()
useEffect(() => {
- if (location.pathname !== '/') {
+ if (location.pathname !== '/40+') {
return
}
diff --git a/src/pages/recipe.tsx b/src/pages/recipe.tsx
index 782ae10..dbea505 100644
--- a/src/pages/recipe.tsx
+++ b/src/pages/recipe.tsx
@@ -163,7 +163,7 @@ function Recipe() {
alignItems="center"
top={{ base: "140px", md: "140px", lg: "140px", xl: "140px" }}
left={{ base: "0vw", md: "2vw", lg: "2vw", xl: "2vw" }}
- onClick={() => router.navigate({ to: '/' })}
+ onClick={() => router.navigate({ to: '/40+' })}
cursor="pointer"
_hover={{ opacity: 0.8 }}
>
diff --git a/src/router.tsx b/src/router.tsx
index f28b03e..389f648 100644
--- a/src/router.tsx
+++ b/src/router.tsx
@@ -9,30 +9,30 @@ const rootRoute = createRootRoute({
component: Layout,
})
-// Main page route (new landing page)
+// Home page route (main landing page at /)
const indexRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/',
- component: MainPage,
-})
-
-// Home page route (old content)
-const homeRoute = createRoute({
- getParentRoute: () => rootRoute,
- path: '/home',
component: HomePage,
})
-// Recipe page route
+// Main page route (40+ page)
+const mainRoute = createRoute({
+ getParentRoute: () => rootRoute,
+ path: '/40+',
+ component: MainPage,
+})
+
+// Recipe page route (under 40+)
const recipeRoute = createRoute({
getParentRoute: () => rootRoute,
- path: '/recipe',
+ path: '/40+/recipe',
component: RecipePage,
})
// Create the router
const router = createRouter({
- routeTree: rootRoute.addChildren([indexRoute, homeRoute, recipeRoute]),
+ routeTree: rootRoute.addChildren([indexRoute, mainRoute, recipeRoute]),
})
export default router
\ No newline at end of file