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

Commit a9b7187

Browse files
committed
chore(Footer): use c11n in store
1 parent 958818e commit a9b7187

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,13 @@ const FooterContainer: FC<TProps> = ({
4040
}) => {
4141
useInit(store, metric)
4242

43-
const {
44-
showSponsor,
45-
viewingArticle,
46-
accountInfo: {
47-
customization: { bannerLayout },
48-
},
49-
// type,
50-
} = store
43+
const { showSponsor, viewingArticle, c11n } = store
5144

5245
return (
53-
<Wrapper testid={testid} layout={bannerLayout} metric={metric}>
46+
<Wrapper testid={testid} layout={c11n.bannerLayout} metric={metric}>
5447
<JoinModal />
5548
{metric === METRIC.COMMUNITY && (
56-
<HomeLayout metric={metric} layout={bannerLayout} />
49+
<HomeLayout metric={metric} layout={c11n.bannerLayout} />
5750
)}
5851
{metric === METRIC.WORKS_ARTICLE && (
5952
<WorksArticleLayout viewingArticle={viewingArticle} />
@@ -66,7 +59,7 @@ const FooterContainer: FC<TProps> = ({
6659
)} */}
6760
{metric === METRIC.ARTICLE && (
6861
<ArticleView
69-
layout={bannerLayout}
62+
layout={c11n.bannerLayout}
7063
metric={metric}
7164
viewingArticle={viewingArticle}
7265
/>

src/containers/unit/Footer/store.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { types as T, getParent, Instance } from 'mobx-state-tree'
77

8-
import type { TRootStore, TAccount, TArticle, TCommunity } from '@/spec'
8+
import type { TRootStore, TAccount, TC11N, TArticle, TCommunity } from '@/spec'
99
import { METRIC } from '@/constant'
1010
import { markStates, toJS } from '@/utils/mobx'
1111

@@ -24,7 +24,10 @@ const FooterStore = T.model('FooterStore', {
2424
const root = getParent(self) as TRootStore
2525
return root.accountInfo
2626
},
27-
27+
get c11n(): TC11N {
28+
const root = getParent(self) as TRootStore
29+
return root.account.c11n
30+
},
2831
get viewingArticle(): TArticle {
2932
const root = getParent(self) as TRootStore
3033
return root.viewingArticle

0 commit comments

Comments
 (0)