|
1 | 1 | import { siteConfig } from '@/lib/config'
|
2 | 2 | import Link from 'next/link'
|
| 3 | +import CONFIG from '../config' |
3 | 4 |
|
4 | 5 | /**
|
5 | 6 | * 页脚
|
6 | 7 | * @param {*} param0
|
7 | 8 | * @returns
|
8 | 9 | */
|
9 |
| -const Footer = (props) => { |
| 10 | +const Footer = props => { |
10 | 11 | const d = new Date()
|
11 | 12 | const currentYear = d.getFullYear()
|
12 | 13 | const since = siteConfig('SINCE')
|
13 |
| - const copyrightDate = parseInt(since) < currentYear ? since + '-' + currentYear : currentYear |
| 14 | + const copyrightDate = |
| 15 | + parseInt(since) < currentYear ? since + '-' + currentYear : currentYear |
14 | 16 | const { categoryOptions, customMenu } = props
|
15 | 17 |
|
16 |
| - return <footer id="footer-wrapper" className='relative bg-[#2A2A2A] justify-center w-full leading-6 text-gray-300 text-sm p-10'> |
17 |
| - |
18 |
| - <div id='footer-container' className='w-full mx-auto max-w-screen-xl'> |
19 |
| - |
20 |
| - <div className='flex'> |
21 |
| - <div className='hidden md:flex flex-grow my-6 space-x-20 text-lg '> |
| 18 | + return ( |
| 19 | + <footer |
| 20 | + id='footer-wrapper' |
| 21 | + className='relative bg-[#2A2A2A] justify-center w-full leading-6 text-gray-300 text-sm p-10'> |
| 22 | + <div id='footer-container' className='w-full mx-auto max-w-screen-xl'> |
| 23 | + <div className='flex'> |
| 24 | + {/* 页脚左侧菜单组 */} |
| 25 | + <div className='hidden md:flex flex-grow my-6 space-x-20 text-lg '> |
| 26 | + {/* 分类菜单 */} |
| 27 | + <div> |
| 28 | + <div className='font-bold mb-4 text-white'> |
| 29 | + {siteConfig('COMMERCE_TEXT_FOOTER_MENU_1', 'Product Center')} |
| 30 | + </div> |
| 31 | + <nav |
| 32 | + id='home-nav-button' |
| 33 | + className={'flex flex-col space-y-2 text-start'}> |
| 34 | + {categoryOptions?.map(category => { |
| 35 | + return ( |
| 36 | + <Link |
| 37 | + key={`${category.name}`} |
| 38 | + title={`${category.name}`} |
| 39 | + href={`/category/${category.name}`} |
| 40 | + passHref> |
| 41 | + {category.name} |
| 42 | + </Link> |
| 43 | + ) |
| 44 | + })} |
| 45 | + </nav> |
| 46 | + </div> |
22 | 47 |
|
23 |
| - {/* 分类菜单 */} |
| 48 | + {/* 系统菜单 */} |
| 49 | + <div> |
| 50 | + <div className='font-bold mb-4 text-white'> |
| 51 | + {siteConfig('COMMERCE_TEXT_FOOTER_MENU_2', 'About US')} |
| 52 | + </div> |
| 53 | + <nav |
| 54 | + id='home-nav-button' |
| 55 | + className={'flex flex-col space-y-2 text-start'}> |
| 56 | + {customMenu?.map(menu => { |
| 57 | + return ( |
| 58 | + <Link |
| 59 | + key={`${menu.name}`} |
| 60 | + title={`${menu.name}`} |
| 61 | + href={`${menu.to}`} |
| 62 | + passHref> |
| 63 | + {menu.name} |
| 64 | + </Link> |
| 65 | + ) |
| 66 | + })} |
| 67 | + </nav> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + |
| 71 | + {/* 页脚中部联系方式 */} |
| 72 | + { |
| 73 | + <div className='md:border-l pl-4 border-gray-600 my-6 whitespace-pre-line text-left flex-grow'> |
| 74 | + <div className='font-bold text-l text-white mb-6'> |
| 75 | + {siteConfig('COMMERCE_TEXT_FOOTER_TITLE', 'Contact US', CONFIG)} |
| 76 | + </div> |
| 77 | + <div className='space-y-4'> |
| 78 | + <div className='flex space-x-4 text-2xl'> |
| 79 | + {JSON.parse( |
| 80 | + siteConfig('COMMERCE_CONTACT_WHATSAPP_SHOW', null, CONFIG), |
| 81 | + true |
| 82 | + ) && ( |
24 | 83 | <div>
|
25 |
| - <div className='font-bold mb-4 text-white'>{siteConfig('COMMERCE_TEXT_FOOTER_MENU_1', 'Product Center')}</div> |
26 |
| - <nav id='home-nav-button' className={'flex flex-col space-y-2 text-start'}> |
27 |
| - {categoryOptions?.map(category => { |
28 |
| - return ( |
29 |
| - <Link |
30 |
| - key={`${category.name}`} |
31 |
| - title={`${category.name}`} |
32 |
| - href={`/category/${category.name}`} |
33 |
| - passHref> |
34 |
| - {category.name} |
35 |
| - </Link> |
36 |
| - ) |
37 |
| - })} |
38 |
| - </nav> |
| 84 | + { |
| 85 | + <a |
| 86 | + target='_blank' |
| 87 | + rel='noreferrer' |
| 88 | + href={siteConfig('CONTACT_WHATSAPP', '#', CONFIG)} |
| 89 | + title={'telegram'}> |
| 90 | + <i className='transform hover:scale-125 duration-150 fa-brands fa-whatsapp dark:hover:text-red-400 hover:text-red-600' /> |
| 91 | + </a> |
| 92 | + } |
39 | 93 | </div>
|
| 94 | + )} |
40 | 95 |
|
41 |
| - {/* 系统菜单 */} |
| 96 | + {JSON.parse( |
| 97 | + siteConfig('COMMERCE_CONTACT_TELEGRAM_SHOW', true, CONFIG) |
| 98 | + ) && ( |
42 | 99 | <div>
|
43 |
| - <div className='font-bold mb-4 text-white'>{siteConfig('COMMERCE_TEXT_FOOTER_MENU_2', 'About US')}</div> |
44 |
| - <nav id='home-nav-button' className={'flex flex-col space-y-2 text-start'}> |
45 |
| - {customMenu?.map(menu => { |
46 |
| - return ( |
47 |
| - <Link |
48 |
| - key={`${menu.name}`} |
49 |
| - title={`${menu.name}`} |
50 |
| - href={`${menu.to}`} |
51 |
| - passHref> |
52 |
| - {menu.name} |
53 |
| - </Link> |
54 |
| - ) |
55 |
| - })} |
56 |
| - </nav> |
| 100 | + { |
| 101 | + <a |
| 102 | + target='_blank' |
| 103 | + rel='noreferrer' |
| 104 | + href={siteConfig('CONTACT_TELEGRAM', '#', CONFIG)} |
| 105 | + title={'telegram'}> |
| 106 | + <i className='transform hover:scale-125 duration-150 fab fa-telegram dark:hover:text-red-400 hover:text-red-600' /> |
| 107 | + </a> |
| 108 | + } |
57 | 109 | </div>
|
| 110 | + )} |
58 | 111 | </div>
|
59 |
| - |
60 |
| - {<div className='md:border-l pl-4 border-gray-600 my-6 whitespace-pre-line text-left flex-grow'> |
61 |
| - <div className='font-bold text-l text-white mb-6'>{siteConfig('COMMERCE_TEXT_FOOTER_TITLE', 'Contact US')}</div> |
62 |
| - <div className='space-y-4'> |
63 |
| - <div className='flex space-x-4 text-2xl'> |
64 |
| - {JSON.parse(siteConfig('COMMERCE_CONTACT_WHATSAPP_SHOW'), true) && <div> |
65 |
| - {<a target='_blank' rel='noreferrer' href={siteConfig('CONTACT_WHATSAPP', '#')} title={'telegram'} > |
66 |
| - <i className='transform hover:scale-125 duration-150 fa-brands fa-whatsapp dark:hover:text-red-400 hover:text-red-600' /> |
67 |
| - </a>} |
68 |
| - </div> |
69 |
| - } |
70 |
| - |
71 |
| - {JSON.parse(siteConfig('COMMERCE_CONTACT_TELEGRAM_SHOW', true)) && <div> |
72 |
| - {<a target='_blank' rel='noreferrer' href={siteConfig('CONTACT_TELEGRAM', '#')} title={'telegram'} > |
73 |
| - <i className='transform hover:scale-125 duration-150 fab fa-telegram dark:hover:text-red-400 hover:text-red-600' /> |
74 |
| - </a>} |
75 |
| - </div>} |
76 |
| - |
77 |
| - </div> |
78 |
| - <div className='text-lg'> {siteConfig('CONTACT_EMAIL') && <a target='_blank' rel='noreferrer' title={'email'} href={`mailto:${siteConfig('CONTACT_EMAIL')}`} > |
79 |
| - <i className='transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-red-400 hover:text-red-600' /> {siteConfig('CONTACT_EMAIL')} |
80 |
| - </a>}</div> |
81 |
| - <div className='text-lg'> {siteConfig('CONTACT_PHONE') && <div> |
82 |
| - <i className='transform hover:scale-125 duration-150 fas fa-user dark:hover:text-red-400 hover:text-red-600' /> {siteConfig('CONTACT_PHONE')} |
83 |
| - </div>}</div> |
84 |
| - </div> |
85 |
| - </div>} |
86 |
| - </div> |
87 |
| - |
88 |
| - {/* 底部版权相关 */} |
89 |
| - <div id='footer-copyright-wrapper' className='flex flex-col md:flex-row justify-between border-t border-gray-600 pt-8'> |
90 |
| - <div className='text-start space-y-1'> |
91 |
| - |
92 |
| - {/* 网站所有者 */} |
93 |
| - <div> Copyright <i className='fas fa-copyright' /> {`${copyrightDate}`} <a href={siteConfig('LINK')} className='underline font-bold dark:text-gray-300 '>{siteConfig('AUTHOR')}</a> All Rights Reserved.</div> |
94 |
| - |
95 |
| - {/* 技术支持 */} |
96 |
| - <div className='text-xs text-light-500 dark:text-gray-700'>Powered by <a href='https://github.com/tangly1024/NotionNext' className='dark:text-gray-300'>NotionNext {siteConfig('VERSION')}</a>.</div> |
97 |
| - |
98 |
| - {/* 站点统计 */} |
| 112 | + <div className='text-lg'> |
| 113 | + {' '} |
| 114 | + {siteConfig('CONTACT_EMAIL') && ( |
| 115 | + <a |
| 116 | + target='_blank' |
| 117 | + rel='noreferrer' |
| 118 | + title={'email'} |
| 119 | + href={`mailto:${siteConfig('CONTACT_EMAIL', CONFIG)}`}> |
| 120 | + <i className='transform hover:scale-125 duration-150 fas fa-envelope dark:hover:text-red-400 hover:text-red-600' />{' '} |
| 121 | + {siteConfig('CONTACT_EMAIL')} |
| 122 | + </a> |
| 123 | + )} |
| 124 | + </div> |
| 125 | + <div className='text-lg'> |
| 126 | + {' '} |
| 127 | + {siteConfig('CONTACT_PHONE', null, CONFIG) && ( |
99 | 128 | <div>
|
100 |
| - <span className='hidden busuanzi_container_site_pv'> |
101 |
| - <i className='fas fa-eye' /><span className='px-1 busuanzi_value_site_pv'> </span> </span> |
102 |
| - <span className='pl-2 hidden busuanzi_container_site_uv'> |
103 |
| - <i className='fas fa-users' /> <span className='px-1 busuanzi_value_site_uv'> </span> </span> |
| 129 | + <i className='transform hover:scale-125 duration-150 fas fa-user dark:hover:text-red-400 hover:text-red-600' />{' '} |
| 130 | + {siteConfig('CONTACT_PHONE', null, CONFIG)} |
104 | 131 | </div>
|
| 132 | + )} |
105 | 133 | </div>
|
| 134 | + </div> |
| 135 | + </div> |
| 136 | + } |
| 137 | + |
| 138 | + {/* 页脚右侧图片二维码和文字描述 */} |
| 139 | + { |
| 140 | + <div className='pl-4 border-gray-600 my-6 whitespace-pre-line text-center flex-grow'> |
| 141 | + <div className='font-bold text-l text-white mb-6 text-center'> |
| 142 | + {/* eslint-disable-next-line @next/next/no-img-element */} |
| 143 | + <img |
| 144 | + className='h-36' |
| 145 | + src={siteConfig( |
| 146 | + 'COMMERCE_FOOTER_RIGHT_IMG_URL', |
| 147 | + null, |
| 148 | + CONFIG |
| 149 | + )}></img> |
| 150 | + </div> |
| 151 | + <div className='space-y-4'> |
| 152 | + <div |
| 153 | + className='flex space-x-4 text-center' |
| 154 | + dangerouslySetInnerHTML={{ |
| 155 | + __html: siteConfig( |
| 156 | + 'COMMERCE_FOOTER_RIGHT_TEXT', |
| 157 | + null, |
| 158 | + CONFIG |
| 159 | + ) |
| 160 | + }}></div> |
| 161 | + </div> |
| 162 | + </div> |
| 163 | + } |
| 164 | + </div> |
106 | 165 |
|
107 |
| - {/* 右边公司名字 */} |
108 |
| - <div className='md:text-right'> |
109 |
| - <h1 className='text-xs pt-4 text-light-400 dark:text-gray-400'>{siteConfig('TITLE')} {siteConfig('BIO')}</h1> |
110 |
| - <h2> {siteConfig('DESCRIPTION')}</h2> |
111 |
| - {/* 可选备案信息 */} |
112 |
| - {siteConfig('BEI_AN') && <><i className='fas fa-shield-alt' /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{siteConfig('BEI_AN')}</a></>} |
113 |
| - </div> |
| 166 | + {/* 底部版权相关 */} |
| 167 | + <div |
| 168 | + id='footer-copyright-wrapper' |
| 169 | + className='flex flex-col md:flex-row justify-between border-t border-gray-600 pt-8'> |
| 170 | + <div className='text-start space-y-1'> |
| 171 | + {/* 网站所有者 */} |
| 172 | + <div> |
| 173 | + {' '} |
| 174 | + Copyright <i className='fas fa-copyright' /> {`${copyrightDate}`}{' '} |
| 175 | + <a |
| 176 | + href={siteConfig('LINK')} |
| 177 | + className='underline font-bold dark:text-gray-300 '> |
| 178 | + {siteConfig('AUTHOR')} |
| 179 | + </a>{' '} |
| 180 | + All Rights Reserved. |
114 | 181 | </div>
|
115 | 182 |
|
116 |
| - </div> |
| 183 | + {/* 技术支持 */} |
| 184 | + <div className='text-xs text-light-500 dark:text-gray-700'> |
| 185 | + Powered by{' '} |
| 186 | + <a |
| 187 | + href='https://github.com/tangly1024/NotionNext' |
| 188 | + className='dark:text-gray-300'> |
| 189 | + NotionNext {siteConfig('VERSION')} |
| 190 | + </a> |
| 191 | + . |
| 192 | + </div> |
117 | 193 |
|
118 |
| - </footer > |
| 194 | + {/* 站点统计 */} |
| 195 | + <div> |
| 196 | + <span className='hidden busuanzi_container_site_pv'> |
| 197 | + <i className='fas fa-eye' /> |
| 198 | + <span className='px-1 busuanzi_value_site_pv'> </span>{' '} |
| 199 | + </span> |
| 200 | + <span className='pl-2 hidden busuanzi_container_site_uv'> |
| 201 | + <i className='fas fa-users' />{' '} |
| 202 | + <span className='px-1 busuanzi_value_site_uv'> </span>{' '} |
| 203 | + </span> |
| 204 | + </div> |
| 205 | + </div> |
| 206 | + |
| 207 | + {/* 右边公司名字 */} |
| 208 | + <div className='md:text-right'> |
| 209 | + <h1 className='text-xs pt-4 text-light-400 dark:text-gray-400'> |
| 210 | + {siteConfig('TITLE')} {siteConfig('BIO')} |
| 211 | + </h1> |
| 212 | + <h2> {siteConfig('DESCRIPTION')}</h2> |
| 213 | + {/* 可选备案信息 */} |
| 214 | + {siteConfig('BEI_AN') && ( |
| 215 | + <> |
| 216 | + <i className='fas fa-shield-alt' />{' '} |
| 217 | + <a href='https://beian.miit.gov.cn/' className='mr-2'> |
| 218 | + {siteConfig('BEI_AN')} |
| 219 | + </a> |
| 220 | + </> |
| 221 | + )} |
| 222 | + </div> |
| 223 | + </div> |
| 224 | + </div> |
| 225 | + </footer> |
| 226 | + ) |
119 | 227 | }
|
120 | 228 |
|
121 | 229 | export default Footer
|
0 commit comments