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

Commit 0045b9f

Browse files
authored
refactor(footer): redesign (#1029)
* chore: wip * chore: covert FaceLogo to ts * chore(Footer): re-org items wip * chore(Footer): adjust color * refactor(footer): redesign digest view * refactor(footer): re-org * refactor(Footer): re-org breif view * refactor(footer): re-design non-home community footer
1 parent d7e1309 commit 0045b9f

File tree

31 files changed

+507
-515
lines changed

31 files changed

+507
-515
lines changed

src/components/Buttons/ArrowLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import { Wrapper, Text, RightIcon } from './styles/arrow_link'
1717
const log = buildLog('c:Buttons:ArrowLink')
1818

1919
type TProps = {
20-
className: string
20+
className?: string
2121
children?: React.ReactNode
2222
size?: TSIZE
2323
href: string
24-
target: '_blank' | ''
24+
target?: '_blank' | ''
2525
color?: string
2626
hoverColor?: string
2727
}

src/components/CommunityFaceLogo/index.js

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
*
3+
* CommunityFaceLogo
4+
*
5+
*/
6+
7+
import React from 'react'
8+
import { isEmpty } from 'ramda'
9+
10+
import { HCN } from '@/constant'
11+
// import { ICON_BASE } from '@/config'
12+
import { buildLog } from '@/utils'
13+
14+
import { Logo, HomeLogo } from './styles'
15+
16+
/* eslint-disable-next-line */
17+
const log = buildLog('c:CommunityFaceLogo:index')
18+
19+
type TProps = {
20+
noFill?: boolean
21+
src?: string
22+
raw?: string
23+
loading?: boolean | null
24+
className?: string
25+
}
26+
27+
const CommunityFaceLogo: React.FC<TProps> = ({
28+
noFill = false,
29+
src = '',
30+
raw = HCN,
31+
loading,
32+
className = 'community-facelogo-class',
33+
}) => {
34+
if (raw === HCN || isEmpty(src)) {
35+
return (
36+
<HomeLogo
37+
// src={`${ICON_BASE}/site_logo.svg`}
38+
src="https://cps-oss.oss-cn-shanghai.aliyuncs.com/icons/static/new-logo.jpg"
39+
className={className}
40+
/>
41+
)
42+
}
43+
44+
return (
45+
<Logo noFill={noFill} src={src} loading={loading} className={className} />
46+
)
47+
}
48+
49+
export default React.memo(CommunityFaceLogo)

src/components/CommunityFaceLogo/styles/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import styled from 'styled-components'
33
import { theme } from '@/utils'
44
import Img from '@/Img'
55

6-
export const Logo = styled(Img)<{ nonFill: boolean }>`
7-
fill: ${({ nonFill }) => (nonFill ? '' : theme('banner.desc'))};
6+
export const Logo = styled(Img)<{ noFill?: boolean }>`
7+
fill: ${({ noFill }) => (noFill ? '' : theme('banner.desc'))};
88
display: block;
99
`
1010

11-
export const holder = 1
11+
export const HomeLogo = styled(Logo)`
12+
transform: rotate(20deg);
13+
`

src/containers/unit/Footer/DesktopView/BottomInfo.js

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react'
2+
import Link from 'next/link'
3+
4+
import { ROUTE } from '@/constant'
5+
6+
import {
7+
Wrapper,
8+
InnerWrapper,
9+
BeianLink,
10+
CompanyLink,
11+
} from '../styles/desktop_view/bottom_info'
12+
13+
const BottomInfo: React.FC = () => (
14+
<Wrapper>
15+
<InnerWrapper>
16+
<CompanyLink href={ROUTE.SPONSOR}>
17+
Groupher @ 2021. 保留所有权利。
18+
</CompanyLink>
19+
<BeianLink href="http://beian.miit.gov.cn">蜀ICP备17043722号-4</BeianLink>
20+
</InnerWrapper>
21+
</Wrapper>
22+
)
23+
24+
export default React.memo(BottomInfo)

src/containers/unit/Footer/DesktopView/BriefView.js renamed to src/containers/unit/Footer/DesktopView/BriefView.tsx

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,72 @@
11
import React from 'react'
22

3-
import { ISSUE_ADDR, ICON_CMD, API_SERVER_ADDR } from '@/config'
3+
import { ISSUE_ADDR, API_SERVER_ADDR } from '@/config'
4+
5+
import TopInfo from './TopInfo'
6+
import BottomInfo from './BottomInfo'
47

58
import {
69
Wrapper,
710
InnerWrapper,
811
MainInfos,
912
BaseInfo,
10-
Divider,
1113
Item,
12-
Support,
13-
CenterLogosWrapper,
14-
SiteLogo,
15-
LogoDivider,
16-
GithubLogo,
1714
} from '../styles/desktop_view/brief_view'
1815

19-
import { toggleSponsorHelper, toggleBusBanner } from '../logic'
16+
type TProps = {
17+
curView: string // todo
18+
metric: string
19+
}
2020

21-
const BriefView = ({ curView, metric }) => {
21+
const BriefView: React.FC<TProps> = ({ curView, metric }) => {
2222
return (
23-
<Wrapper>
24-
<InnerWrapper metric={metric}>
23+
<Wrapper metric={metric}>
24+
<InnerWrapper>
25+
<TopInfo noBottomBorder />
2526
<MainInfos center={curView === 'BRIEF' || false}>
2627
<BaseInfo>
2728
<Item href="/home/post/1" rel="noopener noreferrer" target="_blank">
2829
关于
2930
</Item>
30-
<Divider>|</Divider>
3131
<Item
3232
href="/cps-support/posts"
3333
rel="noopener noreferrer"
3434
target="_blank"
3535
>
36-
使用指南
36+
创建社区
3737
</Item>
38-
<Divider>|</Divider>
3938
<Item
40-
href={`${ISSUE_ADDR}`}
39+
href="/cps-support/posts"
4140
rel="noopener noreferrer"
4241
target="_blank"
4342
>
44-
反馈与建议
43+
加入我们
4544
</Item>
46-
<CenterLogosWrapper>
47-
<SiteLogo />
48-
<LogoDivider radius={4} space={10} />
49-
<GithubLogo src={`${ICON_CMD}/github.svg`} />
50-
</CenterLogosWrapper>
5145
<Item
5246
href={`${API_SERVER_ADDR}`}
5347
rel="noopener noreferrer"
5448
target="_blank"
5549
>
56-
API
50+
OpenSource
51+
</Item>
52+
<Item
53+
href={`${API_SERVER_ADDR}`}
54+
rel="noopener noreferrer"
55+
target="_blank"
56+
>
57+
特别感谢
5758
</Item>
58-
<Divider>|</Divider>
59-
<Item onClick={toggleBusBanner}>商务合作</Item>
60-
61-
<Divider>|</Divider>
62-
<Support onClick={toggleSponsorHelper}>打赏</Support>
63-
<Divider>|</Divider>
6459
<Item
65-
href={`${ISSUE_ADDR}/269`}
60+
href={`${ISSUE_ADDR}`}
6661
rel="noopener noreferrer"
6762
target="_blank"
6863
>
69-
客户端
64+
反馈与建议
7065
</Item>
7166
</BaseInfo>
7267
</MainInfos>
7368
</InnerWrapper>
69+
<BottomInfo />
7470
</Wrapper>
7571
)
7672
}

src/containers/unit/Footer/DesktopView/BusinessNote.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/containers/unit/Footer/DesktopView/DigestView/ContactBar.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)