Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 9f89ca7

Browse files
committed
chore(deploy): footer links style & fixed header clean up
1 parent 1c72450 commit 9f89ca7

File tree

10 files changed

+56
-54
lines changed

10 files changed

+56
-54
lines changed

src/containers/digest/ArticleDigest/DesktopView/FixedHeader.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, memo, Fragment } from 'react'
22

3-
import type { TArticle, TMetric, TThread } from '@/spec'
3+
import type { TArticle, TWorks, TMetric, TThread } from '@/spec'
44
import { METRIC } from '@/constant'
55

66
import Upvote from '@/widgets/Upvote'
@@ -22,12 +22,13 @@ const TitleContent: FC<{ article: TArticle; metric: TMetric }> = ({
2222
}) => {
2323
switch (metric) {
2424
case METRIC.WORKS_ARTICLE: {
25+
const works = article as TWorks
2526
return (
2627
<Fragment>
27-
<Cover src="https://avatars.githubusercontent.com/u/2041385?s=64&v=4" />
28-
<Title>CoderPlanets</Title>
28+
<Cover src={works.cover} />
29+
<Title>{works.title}</Title>
2930
<DotDivider space={10} />
30-
<Desc>可能是最性感的开发者社区, 可能是最性感的开发者社区</Desc>
31+
<Desc>{works.desc}</Desc>
3132
</Fragment>
3233
)
3334
}

src/containers/unit/Footer/DesktopView/ArticleLayout.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FC, memo } from 'react'
44
import Link from 'next/link'
55

66
import type { TArticle, TC11NLayout, TMetric } from '@/spec'
7-
import { GITHUB } from '@/config'
7+
import { ICON, GITHUB } from '@/config'
88
import { METRIC, ROUTE } from '@/constant'
99
import { joinUS } from '@/utils/helper'
1010

@@ -18,6 +18,7 @@ import {
1818
BaseInfo,
1919
Item,
2020
NoLinkItem,
21+
HeartCrabIcon,
2122
} from '../styles/desktop_view/article_layout'
2223

2324
type TProps = {
@@ -44,11 +45,14 @@ const BriefView: FC<TProps> = ({ metric, article, layout }) => {
4445
<Item href={`${GITHUB}`} rel="noopener noreferrer" target="_blank">
4546
Github
4647
</Item>
47-
<Link href={`/${ROUTE.SPONSOR}`} passHref>
48-
<Item>❤️&nbsp;特别感谢</Item>
49-
</Link>
5048
<Link href="/feedback" passHref>
51-
<Item>反馈与建议</Item>
49+
<Item>反馈 &amp; 建议</Item>
50+
</Link>
51+
<Link href={`/${ROUTE.SPONSOR}`} passHref>
52+
<Item>
53+
<HeartCrabIcon src={`${ICON}/emotion/heart.png`} noLazy />
54+
特别感谢
55+
</Item>
5256
</Link>
5357
</BaseInfo>
5458
</MainInfos>

src/containers/unit/Footer/DesktopView/TopInfo/WorksArticle.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ import {
88
Wrapper,
99
InfoBar,
1010
CommunityTitle,
11+
ArticleTitle,
1112
Logo,
1213
} from '../../styles/desktop_view/top_info/article'
1314

14-
type TProps = Pick<TTopInfoProps, 'noBottomBorder'>
15+
type TProps = TTopInfoProps
1516

16-
const Article: FC<TProps> = ({ noBottomBorder = false }) => {
17+
const WorksArticle: FC<TProps> = ({ article, noBottomBorder = false }) => {
1718
return (
1819
<Wrapper noBottomBorder={noBottomBorder}>
1920
<InfoBar>
2021
<Logo />
2122
</InfoBar>
22-
<BlinkCursor duration={2} />
2323
<CommunityTitle>作品集市</CommunityTitle>
24+
<BlinkCursor duration={2} top={0} />
25+
<ArticleTitle>{article.title}</ArticleTitle>
2426
</Wrapper>
2527
)
2628
}
2729

28-
export default memo(Article)
30+
export default memo(WorksArticle)

src/containers/unit/Footer/DesktopView/WorksArticleLayout.tsx

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { FC, memo } from 'react'
22

3+
import Link from 'next/link'
34
import type { TArticle } from '@/spec'
4-
import { ISSUE_ADDR, API_SERVER_ADDR, GITHUB } from '@/config'
5-
import { METRIC } from '@/constant'
5+
import { ICON, GITHUB } from '@/config'
6+
import { METRIC, ROUTE } from '@/constant'
67
import { joinUS } from '@/utils/helper'
78

89
import TopInfo from './TopInfo'
@@ -15,6 +16,7 @@ import {
1516
BaseInfo,
1617
Item,
1718
NoLinkItem,
19+
HeartCrabIcon,
1820
} from '../styles/desktop_view/works_article_layout'
1921

2022
type TProps = {
@@ -32,34 +34,25 @@ const WorksArticleLayout: FC<TProps> = ({ viewingArticle }) => {
3234
/>
3335
<MainInfos>
3436
<BaseInfo>
35-
<Item href="/home/post/1" rel="noopener noreferrer" target="_blank">
36-
关于
37-
</Item>
38-
<Item
39-
href="/cps-support/posts"
40-
rel="noopener noreferrer"
41-
target="_blank"
42-
>
43-
创建社区
44-
</Item>
37+
<Link href="/home/post/1" passHref>
38+
<Item>关于</Item>
39+
</Link>
40+
<Link href={`/${ROUTE.APPLY_COMMUNITY}`} passHref>
41+
<Item>创建社区</Item>
42+
</Link>
4543
<NoLinkItem onClick={() => joinUS()}>加入群聊</NoLinkItem>
4644
<Item href={`${GITHUB}`} rel="noopener noreferrer" target="_blank">
4745
Github
4846
</Item>
49-
<Item
50-
href={`${API_SERVER_ADDR}`}
51-
rel="noopener noreferrer"
52-
target="_blank"
53-
>
54-
特别感谢
55-
</Item>
56-
<Item
57-
href={`${ISSUE_ADDR}`}
58-
rel="noopener noreferrer"
59-
target="_blank"
60-
>
61-
反馈与建议
62-
</Item>
47+
<Link href="/feedback" passHref>
48+
<Item>反馈 &amp; 建议</Item>
49+
</Link>
50+
<Link href={`/${ROUTE.SPONSOR}`} passHref>
51+
<Item>
52+
<HeartCrabIcon src={`${ICON}/emotion/heart.png`} noLazy />
53+
特别感谢
54+
</Item>
55+
</Link>
6356
</BaseInfo>
6457
</MainInfos>
6558
</InnerWrapper>

src/containers/unit/Footer/styles/desktop_view/article_layout.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { C11N } from '@/constant'
55
import { theme } from '@/utils/themes'
66
import css from '@/utils/css'
77

8+
export { HeartCrabIcon } from './home_layout'
9+
810
type TWrapper = { metric: TMetric; layout: TC11NLayout }
911
export const Wrapper = styled.div<TWrapper>`
1012
${css.flexColumn('align-end')};
@@ -35,6 +37,7 @@ export const BaseInfo = styled.div`
3537
${css.flex()};
3638
`
3739
export const Item = styled(Link)`
40+
${css.flex('align-center')};
3841
margin-right: 25px;
3942
`
4043
export const NoLinkItem = styled.div`

src/containers/unit/Footer/styles/desktop_view/home_layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ export const ItemGitSource = styled.div`
7878

7979
export const HeartCrabIcon = styled(Img)`
8080
${css.size(13)};
81-
margin-right: 5px;
81+
margin-right: 7px;
8282
filter: saturate(0.6);
8383
`

src/containers/unit/Footer/styles/desktop_view/top_info/article.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ export const InfoBar = styled(DefaultInfoBar)``
1616
export const Logo = styled(DefaultLogo)`
1717
${css.size(16)};
1818
margin-right: 5px;
19-
margin-top: -2px;
19+
margin-top: -4px;
2020
`
2121
export const ArticleTitle = styled(DefaultSiteTitle)`
2222
color: ${theme('footer.title')};
2323
${css.cutRest('300px')};
2424
font-size: 15px;
2525
font-weight: normal;
26-
margin-top: -2px;
26+
margin-top: -1px;
2727
`
2828
export const CommunityTitle = styled(ArticleTitle)`
2929
margin-right: 6px;
3030
text-decoration: none;
31+
margin-top: 0;
3132
&:hover {
3233
color: ${theme('footer.title')};
3334
cursor: pointer;

src/containers/unit/Footer/styles/desktop_view/works_article_layout.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { theme } from '@/utils/themes'
55
import css from '@/utils/css'
66

77
export { NoLinkItem } from './article_layout'
8+
export { HeartCrabIcon } from './home_layout'
89

910
export const Wrapper = styled.div`
1011
${css.flexColumn('align-end')};
@@ -32,5 +33,6 @@ export const BaseInfo = styled.div`
3233
${css.flex()};
3334
`
3435
export const Item = styled(Link)`
36+
${css.flex('align-center')};
3537
margin-right: 25px;
3638
`

src/widgets/BlinkCursor/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FC, memo } from 'react'
88

99
import { buildLog } from '@/utils/logger'
1010

11+
import type { TSpace } from '@/spec'
1112
import { Wrapper } from './styles'
1213

1314
/* eslint-disable-next-line */
@@ -16,11 +17,8 @@ const log = buildLog('c:BlinkCursor:index')
1617
type TProps = {
1718
testid?: string
1819
height?: number
19-
top?: number
20-
left?: number
21-
right?: number
2220
duration?: number
23-
}
21+
} & TSpace
2422

2523
const BlinkCursor: FC<TProps> = ({
2624
testid = 'blink-cursor',

src/widgets/BlinkCursor/styles/index.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import styled from 'styled-components'
22

3-
import type { TTestable } from '@/spec'
3+
import type { TTestable, TSpace } from '@/spec'
44

55
import animate from '@/utils/animations'
66

7-
export type TWrapper = TTestable & {
8-
height: number
9-
top: number
10-
left: number
11-
right: number
12-
duration: number
13-
}
7+
export type TWrapper = TTestable &
8+
TSpace & {
9+
height: number
10+
duration: number
11+
}
1412

1513
export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
1614
'data-test-id': testid,

0 commit comments

Comments
 (0)