Skip to content

Commit b92126a

Browse files
committed
feat: update docs link
Signed-off-by: coder-sett <[email protected]>
1 parent e32e9c3 commit b92126a

File tree

4 files changed

+62
-19
lines changed

4 files changed

+62
-19
lines changed

apps/web/src/common/components/Header/AllDropdown.tsx

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { RiLineChartLine, RiBarChartLine } from 'react-icons/ri';
88
import { AiOutlineSelect } from 'react-icons/ai';
99
import { GoMirror } from 'react-icons/go';
1010
import { useUserInfo } from '@modules/auth';
11+
import LinkX from '../LinkX';
1112

1213
const MoreDropdown = () => {
1314
const { t } = useTranslation();
@@ -24,6 +25,10 @@ const MoreDropdown = () => {
2425
link: '/os-situation',
2526
linkText: t('common:header.product_home'),
2627
},
28+
{
29+
link: '/docs/docs/service-guide/open-source-insights/',
30+
linkText: t('common:header.service_guide'),
31+
},
2732
],
2833
},
2934
{
@@ -35,6 +40,10 @@ const MoreDropdown = () => {
3540
link: '/os-selection',
3641
linkText: t('common:header.product_home'),
3742
},
43+
{
44+
link: '/docs/docs/service-guide/software-selection',
45+
linkText: t('common:header.service_guide'),
46+
},
3847
],
3948
},
4049
{
@@ -43,6 +52,10 @@ const MoreDropdown = () => {
4352
description: t('common:header.developer_influence_description'),
4453
linkItems: [
4554
{ link: '/', linkText: t('common:header.home_input_experience') },
55+
{
56+
link: '/docs/docs/service-guide/developer-persona',
57+
linkText: t('common:header.service_guide'),
58+
},
4659
],
4760
},
4861
{
@@ -56,6 +69,10 @@ const MoreDropdown = () => {
5669
link: '/',
5770
linkText: t('common:header.home_input_experience'),
5871
},
72+
{
73+
link: '/docs/quick-start',
74+
linkText: t('common:header.service_guide'),
75+
},
5976
],
6077
},
6178

@@ -78,6 +95,10 @@ const MoreDropdown = () => {
7895
linkText: t('common:header.mirror_site_of_pku'),
7996
target: '_blank',
8097
},
98+
{
99+
link: '/docs/docs/service-guide/research-data-hub',
100+
linkText: t('common:header.service_guide'),
101+
},
81102
],
82103
},
83104
{
@@ -89,6 +110,10 @@ const MoreDropdown = () => {
89110
link: '/intelligent-analysis',
90111
linkText: t('common:header.product_home'),
91112
},
113+
{
114+
link: '/docs/docs/service-guide/open-source-ecology',
115+
linkText: t('common:header.service_guide'),
116+
},
92117
],
93118
},
94119
// 只有 roleLevel >= 2 时才显示智能分析服务
@@ -111,13 +136,13 @@ const MoreDropdown = () => {
111136

112137
return (
113138
<div className="group relative flex h-full items-center transition">
114-
<div className="flex cursor-pointer items-center justify-center py-3 px-7 group-hover:bg-[#333333] xl:mx-1 2xl:px-4">
139+
<div className="flex cursor-pointer items-center justify-center px-7 py-3 group-hover:bg-[#333333] xl:mx-1 2xl:px-4">
115140
<a className={'font-medium text-white'}>
116141
{t('common:header.all_services')}
117142
</a>
118143
<AiFillCaretDown color="#fff" className="ml-2" />
119144
</div>
120-
<div className="z-dropdown invisible fixed top-[82px] left-0 max-h-[calc(100%-80px)] w-[100vw] bg-black/95 opacity-0 transition-all duration-300 ease-in-out group-hover:visible group-hover:opacity-100">
145+
<div className="z-dropdown invisible fixed left-0 top-[82px] max-h-[calc(100%-80px)] w-[100vw] bg-black/95 opacity-0 transition-all duration-300 ease-in-out group-hover:visible group-hover:opacity-100">
121146
<div className="mx-auto w-[1200px] pb-16 text-white md:w-full md:px-4 lg:w-full lg:px-10">
122147
<div className="mt-12 grid grid-cols-4 gap-8 md:grid-cols-1 md:gap-y-6 lg:grid-cols-3">
123148
{services.map((service, index) => (
@@ -129,19 +154,23 @@ const MoreDropdown = () => {
129154
{service.title}
130155
</Link>
131156
</div>
132-
<div className="line-clamp-3 mb-3 text-xs text-[#c1c1c1]">
157+
<div className="mb-3 line-clamp-3 text-xs text-[#c1c1c1]">
133158
{service.description}
134159
</div>
135160
<div className="flex flex-col gap-1 text-sm text-[#8ba5f9]">
136-
{service.linkItems.map((linkItem) => (
137-
<Link
138-
key={linkItem.link}
139-
href={linkItem.link}
140-
target={linkItem.target}
141-
>
142-
<div>{linkItem.linkText}</div>
143-
</Link>
144-
))}
161+
{service.linkItems.map((linkItem) => {
162+
const isDocLink = linkItem.link?.includes('/docs/');
163+
const LinkComponent = isDocLink ? LinkX : Link;
164+
return (
165+
<LinkComponent
166+
key={linkItem.link}
167+
href={linkItem.link}
168+
target={linkItem.target}
169+
>
170+
<div>{linkItem.linkText}</div>
171+
</LinkComponent>
172+
);
173+
})}
145174
</div>
146175
</div>
147176
</div>

apps/web/src/modules/os-selection/components/Banner/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import classnames from 'classnames';
33
import { useTranslation } from 'next-i18next';
4+
import LinkX from '@common/components/LinkX';
45
import style from './index.module.css';
56

67
const Banner = () => {
@@ -14,7 +15,7 @@ const Banner = () => {
1415
>
1516
<div
1617
className={classnames(
17-
'absolute right-28 bottom-0 h-[213px] w-[359px] md:-right-[300px]',
18+
'absolute bottom-0 right-28 h-[213px] w-[359px] md:-right-[300px]',
1819
style.headerBgGraph
1920
)}
2021
></div>
@@ -25,13 +26,19 @@ const Banner = () => {
2526
</div>
2627
<div
2728
className={classnames(
28-
'line-clamp-3 mt-4 mb-4 h-16 max-w-3xl text-base md:-right-[300px]',
29+
'mb-4 mt-4 line-clamp-3 h-16 max-w-3xl text-base md:-right-[300px]',
2930
style.headerdsc
3031
)}
3132
>
3233
{t('os-selection:banner.description')}
3334
</div>
34-
<div className="flex gap-4">{/* <Coutact /> */}</div>
35+
<div className="flex gap-4">
36+
<LinkX href="/docs/docs/service-guide/software-selection">
37+
<div className="h-8 w-32 cursor-pointer bg-gradient-to-r from-[#3d8af7] to-[#0a4bb8] text-center leading-8 text-[#fff]">
38+
{t('os-selection:banner.service_guide')}
39+
</div>
40+
</LinkX>
41+
</div>
3542
</div>
3643
</div>
3744
);

apps/web/src/modules/os-situation/components/Banner/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import classnames from 'classnames';
33
import { useTranslation } from 'next-i18next';
4+
import LinkX from '@common/components/LinkX';
45
import style from './index.module.css';
56

67
const Banner = () => {
@@ -14,7 +15,7 @@ const Banner = () => {
1415
>
1516
<div
1617
className={classnames(
17-
'absolute right-28 bottom-0 h-[213px] w-[359px] md:-right-[300px]',
18+
'absolute bottom-0 right-28 h-[213px] w-[359px] md:-right-[300px]',
1819
style.headerBgGraph
1920
)}
2021
></div>
@@ -25,13 +26,19 @@ const Banner = () => {
2526
</div>
2627
<div
2728
className={classnames(
28-
'line-clamp-3 mt-4 mb-4 h-16 max-w-3xl text-base md:-right-[300px]',
29+
'mb-4 mt-4 line-clamp-3 h-16 max-w-3xl text-base md:-right-[300px]',
2930
style.headerdsc
3031
)}
3132
>
3233
{t('os-situation:banner.description')}
3334
</div>
34-
<div className="flex gap-4">{/* <Coutact /> */}</div>
35+
<div className="flex gap-4">
36+
<LinkX href="/docs/docs/service-guide/open-source-insights/">
37+
<div className="h-8 w-32 cursor-pointer bg-gradient-to-r from-[#3d8af7] to-[#0a4bb8] text-center leading-8 text-[#fff]">
38+
{t('os-situation:banner.service_guide')}
39+
</div>
40+
</LinkX>
41+
</div>
3542
</div>
3643
</div>
3744
);

0 commit comments

Comments
 (0)