diff --git a/moon/apps/web/components/Sidebar/SidebarCratespro.tsx b/moon/apps/web/components/Sidebar/SidebarCratespro.tsx index a535d08e0..5296a235a 100644 --- a/moon/apps/web/components/Sidebar/SidebarCratespro.tsx +++ b/moon/apps/web/components/Sidebar/SidebarCratespro.tsx @@ -1,7 +1,8 @@ -import { ChatBubblePlusIcon } from '@gitmono/ui/Icons' +// import { ChatBubblePlusIcon } from '@gitmono/ui/Icons' import { useRouter } from 'next/router' import { useScope } from '@/contexts/scope' import { SidebarLink } from './SidebarLink' +import Image from 'next/image' export function SidebarCratespro() { const { scope } = useScope() @@ -9,11 +10,19 @@ export function SidebarCratespro() { return ( } + id='rust' + label='Rust' + href={`/${scope}/rust`} + active={router.pathname === '/[org]/rust'} + leadingAccessory={ + Rust Logo + } /> ) } \ No newline at end of file diff --git a/moon/apps/web/pages/[org]/cratespro/index.tsx b/moon/apps/web/pages/[org]/cratespro/index.tsx deleted file mode 100644 index 4303fac6b..000000000 --- a/moon/apps/web/pages/[org]/cratespro/index.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import Head from 'next/head' - import { useRouter } from 'next/router' -import { ChatBubblePlusIcon } from '@gitmono/ui/Icons' - -import { AppLayout } from '@/components/Layout/AppLayout' -import AuthAppProviders from '@/components/Providers/AuthAppProviders' -import { PageWithLayout } from '@/utils/types' - -const Logo = () => ( -
- - Rust -
-) - -const MagnifierIcon = () => ( - -) - -const cardList = [ - { - key: 'distribute', - title: 'Rust Distribute', - icon: ( - - ), - bg: 'from-pink-50 to-white', - }, - { - key: 'ecosystem', - title: 'Crate Ecosystem', - icon: ( - - ), - bg: 'from-yellow-50 to-white', - }, - { - key: 'tour', - title: 'Rust Tour & Doc', - icon: ( - - ), - bg: 'from-pink-50 to-white', - }, - { - key: 'news', - title: 'Rust News', - icon: ( - - ), - bg: 'from-blue-50 to-white', - }, -] - -const CratesproPage: PageWithLayout = () => { - const router = useRouter() - - const handleCardClick = (key: string) => { - // 这里可以根据key跳转到不同页面 - router.push(`/cratespro/${key}`) - alert(`点击了 ${key}`) - } - - return ( - <> - - Cratespro - -
- {/* 顶部栏,参考 issue 主页样式 */} -
-
- -
- - - - -
-
-
-
- -
- {cardList.map(card => ( - - ))} -
-
- - ) -} - -CratesproPage.getProviders = (page, pageProps) => { - return ( - - {page} - - ) -} - -export default CratesproPage \ No newline at end of file diff --git a/moon/apps/web/pages/[org]/rust/index.tsx b/moon/apps/web/pages/[org]/rust/index.tsx new file mode 100644 index 000000000..cd2f546a9 --- /dev/null +++ b/moon/apps/web/pages/[org]/rust/index.tsx @@ -0,0 +1,121 @@ +import Head from 'next/head' +import { useRouter } from 'next/router' +// import { ChatBubblePlusIcon } from '@gitmono/ui/Icons' + +import { AppLayout } from '@/components/Layout/AppLayout' +import AuthAppProviders from '@/components/Providers/AuthAppProviders' +import { PageWithLayout } from '@/utils/types' +import { IndexSearchInput } from '@/components/IndexPages/components' +import { useState } from 'react' +import Image from 'next/image' + +const Logo = () => ( +
+ Rust Logo + Rust +
+) + + +const cardList = [ + { + key: 'distribth', + title: 'Rust Distribute', + icon: '/rust/Rust-Distribth.png', + bgStyle: 'bg-gradient-to-br from-[#FFF0F5] to-[#FFFFFF]', + }, + { + key: 'ecosystem', + title: 'Crate Ecosystem', + icon: '/rust/Crate Ecosystem.png', + bgStyle: 'bg-gradient-to-br from-[#FFFCF0] to-[#FFFFFF]', + }, + { + key: 'tour', + title: 'Rust Tour & Doc', + icon: '/rust/Rust-Tour-Doc.png', + bgStyle: 'bg-gradient-to-br from-[#FFF4F0] to-[#FFFFFF]', + }, + { + key: 'news', + title: 'Rust News', + icon: '/rust/Rust-News.png', + bgStyle: 'bg-gradient-to-br from-[#F0FBFF] to-[#FFFFFF]', + }, +] + +const CratesproPage: PageWithLayout = () => { + const router = useRouter() + const [query, setQuery] = useState('') + const isSearchLoading = false // 如有异步搜索可改为实际loading + + const handleCardClick = (key: string) => { + if (key === 'news') { + // 在新标签页打开 rust-news 页面 + const org = router.query.org ? `/${router.query.org}` : '' + + window.open(`${org}/rust/rust-news`, '_blank') + } else { + // 其它卡片逻辑 + router.push(`/cratespro/${key}`) + alert(`点击了 ${key}`) + } + } + + return ( + <> + + Cratespro + +
+ {/* 顶部栏,参考 issue 主页样式 */} +
+
+ +
+ {/* 复用calls页面的搜索栏 */} + +
+
+
+
+ {/* 主体卡片区,居中且间距大,卡片样式按设计稿 */} +
+ {cardList.map(card => ( + + ))} +
+
+ + ) +} + +CratesproPage.getProviders = (page, pageProps) => { + return ( + + {page} + + ) +} + +export default CratesproPage \ No newline at end of file diff --git a/moon/apps/web/pages/[org]/rust/rust-news/index.tsx b/moon/apps/web/pages/[org]/rust/rust-news/index.tsx new file mode 100644 index 000000000..11aee8660 --- /dev/null +++ b/moon/apps/web/pages/[org]/rust/rust-news/index.tsx @@ -0,0 +1,280 @@ +import Head from 'next/head' +import { useState } from 'react' +import { IndexSearchInput } from '@/components/IndexPages/components' +import Image from 'next/image' + +const newsList = [ + { + date: '11-06', + year: '2025', + title: '聚焦Rust数字浪潮奔涌的时代,书写着未来技术的恢弘篇章。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '在数字浪潮奔涌的时代,北京举办的Rust China Tour再度回归,汇聚全球开发者与科技领袖的视野,开启一场新篇章的盛宴。', + }, + { + date: '10-26', + year: '2025', + title: 'Rust生态系统持续壮大,创新应用层出不穷。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: 'Rust生态系统在2025年迎来新一轮爆发,众多企业和开发者积极参与,推动技术创新与产业升级。', + }, + { + date: '09-14', + year: '2025', + title: 'Rust助力数字基础设施升级,安全与性能并重。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '随着数字经济的发展,Rust语言以其安全性和高性能成为基础设施建设的首选,广受业界关注。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '11-06', + year: '2025', + title: 'Rust技术赋能智能制造,推动产业升级。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '智能制造领域引入Rust技术,提升了系统的稳定性与安全性,助力企业实现数字化转型。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '10-26', + year: '2025', + title: 'Rust生态系统持续壮大,创新应用层出不穷。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: 'Rust生态系统在2025年迎来新一轮爆发,众多企业和开发者积极参与,推动技术创新与产业升级。', + }, + { + date: '09-14', + year: '2025', + title: 'Rust助力数字基础设施升级,安全与性能并重。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '随着数字经济的发展,Rust语言以其安全性和高性能成为基础设施建设的首选,广受业界关注。', + }, + { + date: '11-06', + year: '2025', + title: 'Rust技术赋能智能制造,推动产业升级。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '智能制造领域引入Rust技术,提升了系统的稳定性与安全性,助力企业实现数字化转型。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '10-26', + year: '2025', + title: 'Rust生态系统持续壮大,创新应用层出不穷。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: 'Rust生态系统在2025年迎来新一轮爆发,众多企业和开发者积极参与,推动技术创新与产业升级。', + }, + { + date: '09-14', + year: '2025', + title: 'Rust助力数字基础设施升级,安全与性能并重。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '随着数字经济的发展,Rust语言以其安全性和高性能成为基础设施建设的首选,广受业界关注。', + }, + { + date: '11-06', + year: '2025', + title: 'Rust技术赋能智能制造,推动产业升级。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '智能制造领域引入Rust技术,提升了系统的稳定性与安全性,助力企业实现数字化转型。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '01-22', + year: '2025', + title: 'Rust社区活动精彩纷呈,开发者热情高涨。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: true, + summary: '2025年初,Rust社区举办多场技术沙龙和线上研讨会,吸引了大量开发者参与,推动知识分享与技术交流。', + }, + { + date: '10-26', + year: '2025', + title: 'Rust生态系统持续壮大,创新应用层出不穷。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: 'Rust生态系统在2025年迎来新一轮爆发,众多企业和开发者积极参与,推动技术创新与产业升级。', + }, + { + date: '09-14', + year: '2025', + title: 'Rust助力数字基础设施升级,安全与性能并重。', + tags: ['行业新闻', '媒体报道', 'Rust'], + hot: false, + summary: '随着数字经济的发展,Rust语言以其安全性和高性能成为基础设施建设的首选,广受业界关注。', + }, + +] + +const tagColor = (tag: string) => { + if (tag === '行业新闻') return 'bg-blue-100 text-blue-600' + if (tag === '媒体报道') return 'bg-green-100 text-green-600' + if (tag === 'Rust') return 'bg-orange-100 text-orange-600' + return 'bg-gray-100 text-gray-600' +} + +export default function RustNewsPage() { + const [search, setSearch] = useState('') + const isSearchLoading = false + + return ( + <> + + Rust News + +
+ {/* 搜索栏 */} +
+
+ +
+
+ {/* 主标题 */} +
+

Rust News

+
+
+ {/* 新闻列表 */} +
+ {newsList + .filter(item => item.title.includes(search) || item.summary.includes(search)) + .map((item) => ( +
+ {/* 日期 */} +
+ {item.date} + {item.year} +
+ {/* 竖线分割 */} +
+ {/* 内容 */} +
+
+ {item.title} + {item.hot && 🔥} +
+
+ {item.tags.map(tag => ( + + {tag} + + ))} +
+
{item.summary}
+
+ {/* 详情按钮 */} +
+ +
+
+ ))} +
+ {/* 右下角up-icon */} + +
+ + ) +} \ No newline at end of file diff --git a/moon/apps/web/public/rust/Crate Ecosystem.png b/moon/apps/web/public/rust/Crate Ecosystem.png new file mode 100644 index 000000000..421bdee45 Binary files /dev/null and b/moon/apps/web/public/rust/Crate Ecosystem.png differ diff --git a/moon/apps/web/public/rust/Rust-Distribth.png b/moon/apps/web/public/rust/Rust-Distribth.png new file mode 100644 index 000000000..1c25452da Binary files /dev/null and b/moon/apps/web/public/rust/Rust-Distribth.png differ diff --git a/moon/apps/web/public/rust/Rust-News.png b/moon/apps/web/public/rust/Rust-News.png new file mode 100644 index 000000000..1df7d1aa3 Binary files /dev/null and b/moon/apps/web/public/rust/Rust-News.png differ diff --git a/moon/apps/web/public/rust/Rust-Tour-Doc.png b/moon/apps/web/public/rust/Rust-Tour-Doc.png new file mode 100644 index 000000000..d66a072aa Binary files /dev/null and b/moon/apps/web/public/rust/Rust-Tour-Doc.png differ diff --git a/moon/apps/web/public/rust/logo.png b/moon/apps/web/public/rust/logo.png new file mode 100644 index 000000000..de0d93d3a Binary files /dev/null and b/moon/apps/web/public/rust/logo.png differ diff --git a/moon/apps/web/public/rust/normal.png b/moon/apps/web/public/rust/normal.png new file mode 100644 index 000000000..71c22ead8 Binary files /dev/null and b/moon/apps/web/public/rust/normal.png differ diff --git a/moon/apps/web/public/rust/rust-news/up-icon.png b/moon/apps/web/public/rust/rust-news/up-icon.png new file mode 100644 index 000000000..8294a2869 Binary files /dev/null and b/moon/apps/web/public/rust/rust-news/up-icon.png differ diff --git a/moon/apps/web/public/rust/search-icon.png b/moon/apps/web/public/rust/search-icon.png new file mode 100644 index 000000000..006dcfaf7 Binary files /dev/null and b/moon/apps/web/public/rust/search-icon.png differ diff --git a/moon/apps/web/styles/global.css b/moon/apps/web/styles/global.css index 218b08678..1c8ac31c8 100644 --- a/moon/apps/web/styles/global.css +++ b/moon/apps/web/styles/global.css @@ -15,7 +15,7 @@ } #__next { - @apply isolate flex h-full min-h-[100svh] flex-1 flex-col overflow-hidden; + @apply isolate flex h-full min-h-[100svh] flex-1 flex-col overflow-auto; -webkit-app-region: no-drag; }