@coffic/cosy-ui 0.1.28 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffic/cosy-ui",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "A astro component library",
5
5
  "repository": {
6
6
  "url": "https://github.com/CofficLab/cosy-ui"
@@ -22,12 +22,21 @@ const {
22
22
  termsLink,
23
23
  privacyLink,
24
24
  socialLinks = [],
25
+ teamLink,
26
+ careersLink,
27
+ newsLink,
28
+ historyLink,
29
+ partnersLink,
30
+ blogLink,
31
+ faqLink,
32
+ mediaLink,
33
+ techStackLink,
25
34
  }: Props = Astro.props;
26
35
 
27
36
  const currentYear = new Date().getFullYear();
28
37
 
29
38
  // 处理社交链接
30
- const processedSocialLinks = socialLinks.map((link) => processSocialLink(link));
39
+ const processedSocialLinks = socialLinks.map((url) => processSocialLink(url));
31
40
  ---
32
41
 
33
42
  <footer class="bg-base-200/50 dark:bg-base-300/50 z-50 backdrop-blur-md">
@@ -69,11 +78,11 @@ const processedSocialLinks = socialLinks.map((link) => processSocialLink(link));
69
78
 
70
79
  {
71
80
  products.length > 0 && (
72
- <nav class="place-self-center text-center flex flex-col items-center min-h-[200px]">
81
+ <nav class="place-self-start text-center flex flex-col items-center min-h-[200px]">
73
82
  <h6 class="footer-title">产品</h6>
74
- <div class="flex flex-col gap-2">
83
+ <div class="flex flex-col">
75
84
  {products.map((product) => (
76
- <Link href={product.href} external={product.external}>
85
+ <Link href={product.href} external={product.external} size="sm">
77
86
  {product.name}
78
87
  </Link>
79
88
  ))}
@@ -83,12 +92,21 @@ const processedSocialLinks = socialLinks.map((link) => processSocialLink(link));
83
92
  }
84
93
 
85
94
  {
86
- (aboutLink || contactLink) && (
87
- <nav class="place-self-center text-center flex flex-col items-center min-h-[200px]">
95
+ (aboutLink || contactLink || teamLink || careersLink || newsLink || historyLink || partnersLink || blogLink || faqLink || mediaLink || techStackLink) && (
96
+ <nav class="place-self-start text-center flex flex-col items-center min-h-[200px]">
88
97
  <h6 class="footer-title">关于</h6>
89
- <div class="flex flex-col gap-2">
90
- {aboutLink && <Link href={aboutLink}>关于我们</Link>}
91
- {contactLink && <Link href={contactLink}>联系我们</Link>}
98
+ <div class="flex flex-col">
99
+ {aboutLink && <Link href={aboutLink} size="sm">关于我们</Link>}
100
+ {teamLink && <Link href={teamLink} size="sm">团队介绍</Link>}
101
+ {careersLink && <Link href={careersLink} size="sm">加入我们</Link>}
102
+ {newsLink && <Link href={newsLink} size="sm">新闻动态</Link>}
103
+ {historyLink && <Link href={historyLink} size="sm">发展历程</Link>}
104
+ {partnersLink && <Link href={partnersLink} size="sm">合作伙伴</Link>}
105
+ {blogLink && <Link href={blogLink} size="sm">技术博客</Link>}
106
+ {techStackLink && <Link href={techStackLink} size="sm">技术栈</Link>}
107
+ {faqLink && <Link href={faqLink} size="sm">常见问题</Link>}
108
+ {mediaLink && <Link href={mediaLink} size="sm">媒体报道</Link>}
109
+ {contactLink && <Link href={contactLink} size="sm">联系我们</Link>}
92
110
  </div>
93
111
  </nav>
94
112
  )
@@ -96,11 +114,11 @@ const processedSocialLinks = socialLinks.map((link) => processSocialLink(link));
96
114
 
97
115
  {
98
116
  (termsLink || privacyLink) && (
99
- <nav class="place-self-center text-center flex flex-col items-center min-h-[200px]">
117
+ <nav class="place-self-start text-center flex flex-col items-center min-h-[200px]">
100
118
  <h6 class="footer-title">法律</h6>
101
- <div class="flex flex-col gap-2">
102
- {termsLink && <Link href={termsLink}>服务条款</Link>}
103
- {privacyLink && <Link href={privacyLink}>隐私政策</Link>}
119
+ <div class="flex flex-col">
120
+ {termsLink && <Link href={termsLink} size="sm">服务条款</Link>}
121
+ {privacyLink && <Link href={privacyLink} size="sm">隐私政策</Link>}
104
122
  </div>
105
123
  </nav>
106
124
  )
@@ -9,12 +9,6 @@ export interface Product {
9
9
  external?: boolean;
10
10
  }
11
11
 
12
- export interface SocialLink {
13
- name: string;
14
- url: string;
15
- platform: string;
16
- }
17
-
18
12
  export interface FooterProps {
19
13
  siteName: string;
20
14
  homeLink: string;
@@ -29,5 +23,14 @@ export interface FooterProps {
29
23
  contactLink?: string;
30
24
  termsLink?: string;
31
25
  privacyLink?: string;
32
- socialLinks?: SocialLink[];
26
+ socialLinks?: string[];
27
+ teamLink?: string;
28
+ careersLink?: string;
29
+ newsLink?: string;
30
+ historyLink?: string;
31
+ partnersLink?: string;
32
+ blogLink?: string;
33
+ faqLink?: string;
34
+ mediaLink?: string;
35
+ techStackLink?: string;
33
36
  }
@@ -4,13 +4,6 @@ interface PlatformConfig {
4
4
  domains: string[];
5
5
  }
6
6
 
7
- // 社交链接类型
8
- export interface SocialLink {
9
- name: string;
10
- url: string;
11
- platform: string;
12
- }
13
-
14
7
  // 处理后的社交链接类型
15
8
  export interface ProcessedSocialLink {
16
9
  url: string;
@@ -76,21 +69,21 @@ function detectPlatform(url: string): [string, PlatformConfig] | null {
76
69
  }
77
70
 
78
71
  // 处理社交链接
79
- export function processSocialLink(link: SocialLink): ProcessedSocialLink {
80
- const platformInfo = detectPlatform(link.url);
72
+ export function processSocialLink(url: string): ProcessedSocialLink {
73
+ const platformInfo = detectPlatform(url);
81
74
 
82
75
  if (!platformInfo) {
83
76
  // 如果无法识别平台,返回默认值
84
77
  return {
85
- url: link.url,
86
- name: link.name,
78
+ url: url,
79
+ name: '社交链接',
87
80
  platform: 'default',
88
81
  };
89
82
  }
90
83
 
91
84
  const [platform, config] = platformInfo;
92
85
  return {
93
- url: link.url,
86
+ url: url,
94
87
  name: config.name,
95
88
  platform,
96
89
  };