This commit is contained in:
eric
2026-03-12 02:43:31 -05:00
parent 51b88291ef
commit 170a9939aa
6 changed files with 61 additions and 18 deletions

View File

@@ -85,6 +85,7 @@ export default memo(function SiteMenu({
{ {
titleKey: "other", titleKey: "other",
items: [ items: [
{ labelKey: "digitalNomadGuide", href: "https://digital.hackrobot.cn/", icon: "📖" },
{ labelKey: "remoteJobs", href: "#", icon: "💼" }, { labelKey: "remoteJobs", href: "#", icon: "💼" },
{ labelKey: "coworking", href: "#", icon: "🏢" }, { labelKey: "coworking", href: "#", icon: "🏢" },
], ],
@@ -134,17 +135,42 @@ export default memo(function SiteMenu({
{t(section.titleKey)} {t(section.titleKey)}
</h3> </h3>
<ul className="space-y-1"> <ul className="space-y-1">
{section.items.map((item) => ( {section.items.map((item) => {
const isExternal = item.href.startsWith("http");
const linkClass = `flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${
item.href !== "#" && !isExternal && (pathname === item.href || (item.href !== "/" && pathname.startsWith(item.href)))
? "bg-[#ff4d4f]/10 text-[#ff4d4f]"
: "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"
}`;
return (
<li key={item.labelKey}> <li key={item.labelKey}>
<Link {isExternal ? (
href={item.href} <a
onClick={onClose} href={item.href}
className={`flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${ target="_blank"
item.href !== "#" && (pathname === item.href || (item.href !== "/" && pathname.startsWith(item.href))) rel="noopener noreferrer"
? "bg-[#ff4d4f]/10 text-[#ff4d4f]" onClick={onClose}
: "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800" className={linkClass}
}`} >
> <span className="w-5 text-center">{item.icon}</span>
<span className="flex-1">{t(item.labelKey)}</span>
{item.new && (
<span className="px-2 py-0.5 rounded-full bg-[#ff4d4f] text-white text-[10px] font-medium">
NEW
</span>
)}
{item.ad && (
<span className="px-2 py-0.5 rounded bg-gray-200 dark:bg-gray-700 text-[10px] text-gray-500">
Ad
</span>
)}
</a>
) : (
<Link
href={item.href}
onClick={onClose}
className={linkClass}
>
<span className="w-5 text-center">{item.icon}</span> <span className="w-5 text-center">{item.icon}</span>
<span className="flex-1">{t(item.labelKey)}</span> <span className="flex-1">{t(item.labelKey)}</span>
{item.new && ( {item.new && (
@@ -158,8 +184,10 @@ export default memo(function SiteMenu({
</span> </span>
)} )}
</Link> </Link>
)}
</li> </li>
))} );
})}
</ul> </ul>
</div> </div>
))} ))}

View File

@@ -17,7 +17,7 @@ export const FOOTER_SECTIONS: FooterSection[] = [
titleKey: "about", titleKey: "about",
links: [ links: [
{ href: "/about", labelKey: "aboutUs" }, { href: "/about", labelKey: "aboutUs" },
{ href: "/blog", labelKey: "blog" }, { href: "https://digital.hackrobot.cn/", labelKey: "digitalNomadGuide" },
{ href: "/careers", labelKey: "careers" }, { href: "/careers", labelKey: "careers" },
{ href: "/press", labelKey: "press" }, { href: "/press", labelKey: "press" },
], ],

View File

@@ -47,7 +47,8 @@
"terms": "TOS & Privacy", "terms": "TOS & Privacy",
"changelog": "Changelog", "changelog": "Changelog",
"remoteJobs": "Remote Jobs", "remoteJobs": "Remote Jobs",
"coworking": "Coworking" "coworking": "Coworking",
"digitalNomadGuide": "Digital Nomad Guide"
}, },
"nav": { "nav": {
"cities": "Cities", "cities": "Cities",
@@ -193,7 +194,7 @@
"report": "Nomad Report", "report": "Nomad Report",
"faq": "FAQ", "faq": "FAQ",
"aboutUs": "About Us", "aboutUs": "About Us",
"blog": "Blog", "digitalNomadGuide": "Digital Nomad Guide",
"careers": "Careers", "careers": "Careers",
"press": "Press", "press": "Press",
"support": "Support", "support": "Support",

View File

@@ -47,7 +47,8 @@
"terms": "条款与隐私", "terms": "条款与隐私",
"changelog": "更新日志", "changelog": "更新日志",
"remoteJobs": "远程工作", "remoteJobs": "远程工作",
"coworking": "共享办公" "coworking": "共享办公",
"digitalNomadGuide": "数字游民指南"
}, },
"nav": { "nav": {
"cities": "城市", "cities": "城市",
@@ -193,7 +194,7 @@
"report": "Nomad 年报", "report": "Nomad 年报",
"faq": "常见问题", "faq": "常见问题",
"aboutUs": "关于我们", "aboutUs": "关于我们",
"blog": "博客", "digitalNomadGuide": "数字游民指南",
"careers": "加入我们", "careers": "加入我们",
"press": "媒体报道", "press": "媒体报道",
"support": "支持", "support": "支持",

View File

@@ -1,7 +1,20 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
/* config options here */ allowedDevOrigins: [
"localhost",
"localhost:3000",
"127.0.0.1",
"127.0.0.1:3000",
"172.27.128.1",
"172.27.128.1:3000",
"192.168.41.222",
"192.168.41.222:3000",
"http://localhost:3000",
"http://127.0.0.1:3000",
"http://172.27.128.1:3000",
"http://192.168.41.222:3000",
],
}; };
export default nextConfig; export default nextConfig;

View File

@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev -H 0.0.0.0",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "eslint" "lint": "eslint"