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

Commit bebefa1

Browse files
authored
chore(js-ts): WorksContent && fix warnigns & ideas (#1052)
1 parent 8f8a802 commit bebefa1

File tree

25 files changed

+90
-542
lines changed

25 files changed

+90
-542
lines changed

src/components/Buttons/OrButton/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ import HorizontalButton from './HorizontalButton'
66
import VerticalButton from './VerticalButton'
77

88
export type TProps = {
9-
direction: 'row' | 'column'
9+
direction?: 'row' | 'column'
1010
size?: TSIZE_SM
1111
activeKey: string
1212
onClick: (key: string) => void
1313
group: {
1414
key: string
1515
title: string
1616
}[]
17-
children: React.ReactNode
1817
}
1918

20-
const OrButton: React.FC<TProps> = ({ direction, ...restProps }) => {
19+
const OrButton: React.FC<TProps> = ({ direction = 'row', ...restProps }) => {
2120
return direction === 'row' ? (
2221
<HorizontalButton {...restProps} />
2322
) : (

src/components/NaviCatalog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type TProps = {
3939
testid?: string
4040
items: TMenuItem[]
4141

42-
onSelect: (id: string, type: string) => void
42+
onSelect?: (id: string, type: string) => void
4343
onShowMore?: () => void
4444
}
4545

src/containers/content/WorksContent/Banner/Backgrounds.js

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

src/containers/content/WorksContent/Banner/Recommendation.js

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

src/containers/content/WorksContent/Banner/index.js

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

src/containers/content/WorksContent/Brand.js renamed to src/containers/content/WorksContent/Brand.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import React from 'react'
22

33
import { Wrapper, Title, Desc } from './styles/brand'
44

5-
const Brand = () => {
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const Brand: React.FC<TProps> = ({ testid = 'works-content-brand' }) => {
610
return (
7-
<Wrapper>
11+
<Wrapper testid={testid}>
812
<Title>作品集市</Title>
913
<Desc>by makers, for makers.</Desc>
1014
</Wrapper>

src/containers/content/WorksContent/FilterBar.js renamed to src/containers/content/WorksContent/FilterBar.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react'
22

3+
import { mockNaviCatalogMenu } from '@/utils'
4+
35
import { Br } from '@/components/Common'
46
import { OrButton } from '@/components/Buttons'
57
import FiltersMenu from '@/components/FiltersMenu'
@@ -12,12 +14,15 @@ import { Wrapper, FilterWrapper } from './styles/filter_bar'
1214

1315
import { changeView } from './logic'
1416

15-
const FilterBar = ({ activeView }) => {
17+
type TProps = {
18+
activeView: string
19+
}
20+
21+
const FilterBar: React.FC<TProps> = ({ activeView }) => {
1622
return (
1723
<Wrapper>
1824
<OrButton
1925
size="small"
20-
type="primary"
2126
activeKey={activeView}
2227
group={[
2328
{
@@ -26,14 +31,18 @@ const FilterBar = ({ activeView }) => {
2631
},
2732
{
2833
key: VIEW.MILESTONE,
29-
title: '动态',
34+
title: '动态', // 里面再成 里程碑,和讨论
3035
},
3136
]}
3237
onClick={changeView}
3338
/>
3439
<Br bottom={30} />
3540
<FilterWrapper>
36-
<NaviCatalog title="类别筛选" withDivider={false} />
41+
<NaviCatalog
42+
title="类别筛选"
43+
withDivider={false}
44+
items={mockNaviCatalogMenu()}
45+
/>
3746
</FilterWrapper>
3847
<Br bottom={40} />
3948
<FilterWrapper>

0 commit comments

Comments
 (0)