Skip to content

Commit 88b3102

Browse files
committed
feat: all site footer
1 parent 32e10e9 commit 88b3102

File tree

12 files changed

+94
-67
lines changed

12 files changed

+94
-67
lines changed

next-sitemap.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ module.exports = {
2626
userAgent: '*',
2727
allow: '/',
2828
disallow: [
29-
'.jpg$',
30-
'.jpeg$',
31-
'.gif$',
32-
'.png$',
33-
'.bmp$',
29+
'/*.jpg$',
30+
'/*.jpeg$',
31+
'/*.gif$',
32+
'/*.png$',
33+
'/*.bmp$',
3434
'/wp-admin/',
3535
'/wp-includes/',
3636
'/cgi-bin/',

src/components/dropdown/Dropdown.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,13 @@ function Dropdown(props: DropdownProps, ref: any) {
155155
onTouchStart={() => setIsHover(true)}
156156
>
157157
{props.options?.map((opt: option) => (
158-
<a
158+
<span
159159
key={opt.key}
160-
href={`${opt.key}`}
161160
className='block cursor-pointer truncate rounded-lg px-1 py-2 text-left text-sm text-gray-500 hover:bg-gray-50 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-300'
162161
onClick={() => onChange(opt)}
163162
>
164163
{opt.value}
165-
</a>
164+
</span>
166165
))}
167166
</div>
168167
</div>

src/components/layout/Footer.tsx

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import { CustomLink } from '@/components/links/CustomLink';
66

77
import FooterLink from './FooterLink';
88

9-
import { SideProps } from '@/types/home';
9+
import { FooterProps } from '@/types/home';
1010

11-
const Footer = ({ t }: SideProps) => {
11+
const Footer = ({ t, isLite }: FooterProps) => {
1212
return (
13-
<footer className='flex flex-wrap items-center px-1 py-2.5 text-xs text-gray-400 lg:px-3'>
13+
<footer className='flex flex-wrap items-center px-1 py-2.5 text-xs text-gray-400 lg:px-2'>
1414
<div className='inline-flex space-x-1 lg:space-x-1.5'>
1515
<FeedbackModal feedbackType={2}>
1616
<div className='cursor-pointer hover:text-blue-500'>
@@ -47,58 +47,64 @@ const Footer = ({ t }: SideProps) => {
4747
</CustomLink>
4848
</p>
4949

50-
<FooterLink href='https://www.ucloud.cn/site/active/kuaijiesale.html?utm_term=logo&utm_campaign=hellogithub&utm_source=otherdsp&utm_medium=display&ytag=logo_hellogithub_otherdsp_display#wulanchabu'>
51-
<div className='mt-2'>
52-
<span>{t('footer.server_sponsor')}</span>
53-
<span className='mx-0.5 align-[1px]'>
54-
<img
55-
className='inline-block'
56-
src='https://img.hellogithub.com/ad/ucloud_footer.png'
57-
width='86'
58-
height='16'
59-
alt='ucloud_footer'
60-
/>
61-
</span>
62-
<span>{t('footer.server_sponsor2')}</span>
63-
</div>
64-
</FooterLink>
65-
66-
<FooterLink href='https://www.upyun.com/league?utm_source=HelloGitHub&utm_medium=adting'>
67-
<div className='mt-2'>
68-
<span>{t('footer.cdn_sponsor')}</span>
69-
<span className='mx-0.5 align-[1px]'>
70-
<img
71-
className='inline-block'
72-
src='https://img.hellogithub.com/ad/upyun_footer.png'
73-
width='42'
74-
height='16'
75-
alt='upyun_footer'
76-
/>
77-
</span>
78-
<span>{t('footer.cdn_sponsor2')}</span>
79-
</div>
80-
</FooterLink>
81-
82-
<FooterLink className='mt-2 block' href='https://beian.miit.gov.cn/'>
83-
<span>京ICP备17046648号-1</span>
50+
<FooterLink
51+
className='mt-2'
52+
href='https://www.ucloud.cn/site/active/kuaijiesale.html?utm_term=logo&utm_campaign=hellogithub&utm_source=otherdsp&utm_medium=display&ytag=logo_hellogithub_otherdsp_display#wulanchabu'
53+
>
54+
<span>{t('footer.server_sponsor')}</span>
55+
<span className='mx-0.5 align-[1px]'>
56+
<img
57+
className='inline-block'
58+
src='https://img.hellogithub.com/ad/ucloud_footer.png'
59+
width='86'
60+
height='16'
61+
alt='ucloud_footer'
62+
/>
63+
</span>
64+
<span>{t('footer.server_sponsor2')}</span>
8465
</FooterLink>
8566

8667
<FooterLink
87-
className='mt-2 block'
88-
href='http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11011402013237'
68+
className='mt-2'
69+
href='https://www.upyun.com/?from=hellogithub'
8970
>
90-
<span>
71+
<span>{t('footer.cdn_sponsor')}</span>
72+
<span className='mx-0.5 align-[1px]'>
9173
<img
9274
className='inline-block'
93-
src='https://img.hellogithub.com/ad/filing.png'
94-
width='12'
95-
height='12'
96-
alt='footer_filing'
75+
src='https://img.hellogithub.com/ad/upyun_footer.png'
76+
width='42'
77+
height='16'
78+
alt='upyun_footer'
9779
/>
98-
京公网安备11011402013237号
9980
</span>
81+
<span>{t('footer.cdn_sponsor2')}</span>
10082
</FooterLink>
10183

84+
{!isLite && (
85+
<FooterLink className='mt-2 block' href='https://beian.miit.gov.cn/'>
86+
<span>京ICP备17046648号-1</span>
87+
</FooterLink>
88+
)}
89+
90+
{!isLite && (
91+
<FooterLink
92+
className='mt-2 block'
93+
href='http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11011402013237'
94+
>
95+
<span>
96+
<img
97+
className='inline-block'
98+
src='https://img.hellogithub.com/ad/filing.png'
99+
width='12'
100+
height='12'
101+
alt='footer_filing'
102+
/>
103+
京公网安备11011402013237号
104+
</span>
105+
</FooterLink>
106+
)}
107+
102108
<p className='mt-2 flex items-center space-x-1 lg:space-x-1.5'>
103109
<span className='cursor-default'>
104110
©{new Date().getFullYear()} HelloGitHub

src/components/layout/FooterLink.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const FooterLink: React.FC<FooterLinkProps> = ({
1616
className={`cursor-pointer hover:text-blue-500 ${className}`}
1717
target='_blank'
1818
href={href}
19+
aria-label='footer-link'
1920
rel='noreferrer'
2021
>
2122
{children}

src/components/loading/skeleton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const StatsSkeleton = () => {
6060

6161
export const RecommendSkeleton = ({ loop }: Props) => {
6262
return (
63-
<>
63+
<div>
6464
{[...Array(loop)].map((x, i) => (
6565
<div key={i} className='flex flex-row rounded-md py-2'>
6666
<div className='flex w-full items-center px-1'>
@@ -74,7 +74,7 @@ export const RecommendSkeleton = ({ loop }: Props) => {
7474
</div>
7575
</div>
7676
))}
77-
</>
77+
</div>
7878
);
7979
};
8080

src/components/navbar/IndexBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const IndexBar: NextPage<Props> = ({ t, i18n_lang, tid, sort_by }) => {
4040
<span onClick={handleTagButton} className={linkClassName('label')}>
4141
{t('nav.tag')}
4242
</span>
43-
<div className='shrink grow'></div>
43+
<div className='shrink grow' />
4444
<div className='md:hidden'>
4545
<RepoModal>
46-
<button className='flex h-8 items-center rounded-lg bg-blue-500 px-3 text-xs text-white active:bg-blue-600 dark:bg-gray-700 dark:text-gray-300 dark:active:bg-gray-900 sm:px-4'>
46+
<div className='flex h-8 items-center rounded-lg bg-blue-500 px-3 text-xs text-white active:bg-blue-600 dark:bg-gray-700 dark:text-gray-300 dark:active:bg-gray-900 sm:px-4'>
4747
{t('nav.submit')}
48-
</button>
48+
</div>
4949
</RepoModal>
5050
</div>
5151
</div>

src/components/navbar/RepoNavbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ const RepoDetailNavbar = ({ avatar, uid, t }: Props) => {
3535
<NoPrefetchLink href={`/user/${uid}`}>
3636
<div className='flex cursor-pointer items-center justify-end text-xs text-gray-500 hover:text-blue-400 dark:text-gray-400'>
3737
{t('nav.desc')}
38-
<div className='m-1 flex items-center'>
38+
<span className='m-1 flex items-center'>
3939
<img
4040
className='rounded-full hover:animate-spin'
4141
src={avatar}
4242
width='18'
4343
height='18'
4444
alt='navbar_avatar'
4545
/>
46-
</div>
46+
</span>
4747
{t('nav.desc2')}
4848
</div>
4949
</NoPrefetchLink>

src/components/report/Report.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,25 @@ export const ChangeColumnRender = (
3131
);
3232
};
3333

34-
export const TrendColumnRender = (row: RankDataItem) => {
34+
export const TrendColumnRender = (
35+
row: RankDataItem,
36+
_showPercent: boolean,
37+
i18n_lang: string
38+
) => {
3539
let icon = <IoMdRemove size={16} />;
3640
if (row.change !== null) {
3741
if (row.change > 0) {
38-
icon = <IoMdTrendingUp size={16} className='text-red-500' />;
42+
if (i18n_lang === 'en') {
43+
icon = <IoMdTrendingUp size={16} className='text-green-500' />;
44+
} else {
45+
icon = <IoMdTrendingUp size={16} className='text-red-500' />;
46+
}
3947
} else {
40-
icon = <IoMdTrendingDown size={16} className=' text-green-500' />;
48+
if (i18n_lang === 'en') {
49+
icon = <IoMdTrendingDown size={16} className='text-red-500' />;
50+
} else {
51+
icon = <IoMdTrendingDown size={16} className=' text-green-500' />;
52+
}
4153
}
4254
}
4355
return <span>{icon}</span>;

src/components/side/Recommend.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function Recommend({ t }: SideProps) {
8989
</div>
9090
</div>
9191
{repositories.length === 0 ? (
92-
<RecommendSkeleton loop={3} />
92+
<RecommendSkeleton loop={5} />
9393
) : (
9494
<RecommendList repositories={repositories} />
9595
)}

src/components/side/Side.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ export const Side = ({ isHome }: { isHome: boolean }) => {
5151
)}
5252
{isHome ? <SiteStats t={t} /> : <Recommend t={t} />}
5353
</div>
54-
{isHome && <Footer t={t} />}
54+
{isHome ? (
55+
<Footer t={t} isLite={false} />
56+
) : (
57+
<Footer t={t} isLite={true} />
58+
)}
5559
</div>
5660
</div>
5761
{adverts && (

0 commit comments

Comments
 (0)