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

Commit 053d292

Browse files
authored
refactor(footer): add general jutify-between style footer (#1199)
1 parent e773bb0 commit 053d292

File tree

6 files changed

+83
-11
lines changed

6 files changed

+83
-11
lines changed

src/containers/unit/Footer/DesktopView/CoolGuideLayout.tsx renamed to src/containers/unit/Footer/DesktopView/GeneralLayout.tsx

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

3+
import type { TMetric } from '@/spec'
34
import { ISSUE_ADDR, API_SERVER_ADDR, GITHUB } from '@/config'
4-
import { METRIC } from '@/constant'
55
import { joinUS } from '@/utils/helper'
66

77
import TopInfo from './TopInfo'
@@ -14,13 +14,17 @@ import {
1414
BaseInfo,
1515
Item,
1616
NoLinkItem,
17-
} from '../styles/desktop_view/cool_guide_layout'
17+
} from '../styles/desktop_view/general_layout'
1818

19-
const CoolGuideLayout: FC = () => {
19+
type TProps = {
20+
metric: TMetric
21+
}
22+
23+
const GeneralLayout: FC<TProps> = ({ metric }) => {
2024
return (
2125
<Wrapper>
2226
<InnerWrapper>
23-
<TopInfo metric={METRIC.COOL_GUIDE} noBottomBorder />
27+
<TopInfo metric={metric} noBottomBorder />
2428
<MainInfos>
2529
<BaseInfo>
2630
<Item href="/home/post/1" rel="noopener noreferrer" target="_blank">
@@ -54,9 +58,9 @@ const CoolGuideLayout: FC = () => {
5458
</BaseInfo>
5559
</MainInfos>
5660
</InnerWrapper>
57-
<BottomInfo metric={METRIC.COOL_GUIDE} />
61+
<BottomInfo metric={metric} />
5862
</Wrapper>
5963
)
6064
}
6165

62-
export default memo(CoolGuideLayout)
66+
export default memo(GeneralLayout)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { FC, memo } from 'react'
2+
3+
import { ICON } from '@/config'
4+
5+
import {
6+
Wrapper,
7+
InfoBar,
8+
CommunityTitle,
9+
ArrowDividerIcon,
10+
Logo,
11+
} from '../../styles/desktop_view/top_info/article'
12+
13+
const Drink: FC = () => {
14+
return (
15+
<Wrapper noBottomBorder>
16+
<InfoBar>
17+
<Logo />
18+
</InfoBar>
19+
<ArrowDividerIcon src={`${ICON}/shape/arrow-simple.svg`} />
20+
<CommunityTitle>来一杯</CommunityTitle>
21+
</Wrapper>
22+
)
23+
}
24+
25+
export default memo(Drink)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { FC, memo } from 'react'
2+
3+
import { ICON } from '@/config'
4+
5+
import {
6+
Wrapper,
7+
InfoBar,
8+
CommunityTitle,
9+
ArrowDividerIcon,
10+
Logo,
11+
} from '../../styles/desktop_view/top_info/article'
12+
13+
const Works: FC = () => {
14+
return (
15+
<Wrapper noBottomBorder>
16+
<InfoBar>
17+
<Logo />
18+
</InfoBar>
19+
<ArrowDividerIcon src={`${ICON}/shape/arrow-simple.svg`} />
20+
<CommunityTitle>作品集市</CommunityTitle>
21+
</Wrapper>
22+
)
23+
}
24+
25+
export default memo(Works)

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import HomeCommunity from './HomeCommunity'
88
import Article from './Article'
99
import WorksArticle from './WorksArticle'
1010
import CoolGuide from './CoolGuide'
11+
import Works from './Works'
12+
import Drink from './Drink'
1113

1214
export type TProps = {
1315
metric?: TMetric
@@ -31,6 +33,14 @@ const TopInfo: FC<TProps> = ({ metric = METRIC.COMMUNITY, ...restProps }) => {
3133
return <CoolGuide />
3234
}
3335

36+
case METRIC.WORKS: {
37+
return <Works />
38+
}
39+
40+
case METRIC.HAVE_A_DRINK: {
41+
return <Drink />
42+
}
43+
3444
// case VIEW.HOSTING_COMMUNITY: {
3545
// return <Community {...restProps} />
3646
// }

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ import JoinModal from '@/containers/tool/JoinModal'
1717
import HomeLayout from './HomeLayout'
1818
import ArticleLayout from './ArticleLayout'
1919
import WorksArticleLayout from './WorksArticleLayout'
20-
import CoolGuideLayout from './CoolGuideLayout'
20+
import GeneralLayout from './GeneralLayout'
2121
// import CommunityView from './CommunityView'
2222
// import HostingCommunityView from './HostingCommunityView'
2323

2424
import type { TStore } from '../store'
2525
import { Wrapper } from '../styles'
26-
import { useInit, toggleSponsorHelper, onLogin } from '../logic'
26+
import { useInit } from '../logic'
2727

2828
/* eslint-disable-next-line */
2929
const log = buildLog('C:Footer')
@@ -41,7 +41,7 @@ const FooterContainer: FC<TProps> = ({
4141
}) => {
4242
useInit(store, metric)
4343

44-
const { showSponsor, viewingArticle, c11n } = store
44+
const { viewingArticle, c11n } = store
4545

4646
return (
4747
<Wrapper testid={testid} layout={c11n.bannerLayout} metric={metric}>
@@ -52,7 +52,14 @@ const FooterContainer: FC<TProps> = ({
5252
{metric === METRIC.WORKS_ARTICLE && (
5353
<WorksArticleLayout viewingArticle={viewingArticle} />
5454
)}
55-
{metric === METRIC.COOL_GUIDE && <CoolGuideLayout />}
55+
{metric === METRIC.COOL_GUIDE && (
56+
<GeneralLayout metric={METRIC.COOL_GUIDE} />
57+
)}
58+
{metric === METRIC.MEETUPS && <GeneralLayout metric={METRIC.MEETUPS} />}
59+
{metric === METRIC.WORKS && <GeneralLayout metric={METRIC.WORKS} />}
60+
{metric === METRIC.HAVE_A_DRINK && (
61+
<GeneralLayout metric={METRIC.HAVE_A_DRINK} />
62+
)}
5663
{/* {type === VIEW.HOME && (
5764
<CommunityView metric={metric} layout={bannerLayout} />
5865
)} */}

src/containers/unit/Footer/styles/desktop_view/cool_guide_layout.ts renamed to src/containers/unit/Footer/styles/desktop_view/general_layout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ export { NoLinkItem } from './article_layout'
99
export const Wrapper = styled.div`
1010
${css.flexColumn('align-start')};
1111
width: 100%;
12-
${css.fitContentWidth(METRIC.COOL_GUIDE)};
12+
${css.fitContentWidth(METRIC.WORKS)};
1313
`
1414
export const InnerWrapper = styled.div`
15+
${css.flex('align-center', 'justify-between')};
1516
width: 100%;
1617
`
1718
export const MainInfos = styled.footer`

0 commit comments

Comments
 (0)