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

Commit de59761

Browse files
committed
fix(typo): comtribute -> contribute
1 parent e488806 commit de59761

File tree

2 files changed

+37
-51
lines changed

2 files changed

+37
-51
lines changed

containers/AccountViewer/ContributeMap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const log = buildLog('C:Comments')
2626

2727
const customTooltipDataAttrs = value => ({
2828
'data-tip': value.date === null ? '' : `${value.count} 次 (${value.date})`,
29-
'data-for': 'user_comtribute_map',
29+
'data-for': 'user_contribute_map',
3030
'data-offset': JSON.stringify({ right: 7 }),
3131
})
3232

@@ -103,7 +103,7 @@ const ContributeMap = ({ data }) => {
103103
type="error"
104104
effect="solid"
105105
place="top"
106-
id="user_comtribute_map"
106+
id="user_contribute_map"
107107
/>
108108
<DotWrapper>
109109
<DotList>

containers/UserBanner/UserContributeMap.js

Lines changed: 35 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const log = buildLog('C:Comments')
2525

2626
const customTooltipDataAttrs = value => ({
2727
'data-tip': value.date === null ? '' : `${value.count} 次 (${value.date})`,
28-
'data-for': 'user_comtribute_map',
28+
'data-for': 'user_contribute_map',
2929
'data-offset': JSON.stringify({ right: 7 }),
3030
})
3131

@@ -62,53 +62,39 @@ const getClass = value => {
6262
}
6363
}
6464

65-
const UserContributeMap = ({ data }) => {
66-
/* if don't jadge empty(first load), the tool tip will not work */
67-
/*
68-
if (R.isEmpty(data.records)) {
69-
return null
70-
}
71-
*/
72-
/*
73-
<TitleWrapper>
74-
<Title>6个月内贡献 {data.totalCount} 次内容</Title>
75-
<HelpText>记录规则?</HelpText>
76-
</TitleWrapper>
77-
*/
65+
const UserContributeMap = ({ data }) => (
66+
<Wrapper className="banner-heatmap">
67+
<CalendarHeatmap
68+
startDate={data.startDate}
69+
endDate={data.endDate}
70+
showMonthLabels
71+
onClick={value => log(value)}
72+
gutterSize={3}
73+
tooltipDataAttrs={customTooltipDataAttrs}
74+
monthLabels={monthLabels}
75+
values={data.records}
76+
classForValue={getClass}
77+
/>
78+
<ReactTooltip
79+
type="error"
80+
effect="solid"
81+
place="top"
82+
id="user_contribute_map"
83+
/>
84+
<DotWrapper>
85+
<Title>6个月内创作 {data.totalCount} 次内容</Title>
86+
<DotList>
87+
<DotText>潜水&nbsp;&nbsp;</DotText>
88+
<ColorDot scale="empty" />
89+
<ColorDot scale="1" />
90+
<ColorDot scale="2" />
91+
<ColorDot scale="3" />
92+
<ColorDot scale="4" />
93+
<ColorDot scale="5" />
94+
<DotText>&nbsp;高产</DotText>
95+
</DotList>
96+
</DotWrapper>
97+
</Wrapper>
98+
)
7899

79-
return (
80-
<Wrapper className="banner-heatmap">
81-
<CalendarHeatmap
82-
startDate={data.startDate}
83-
endDate={data.endDate}
84-
showMonthLabels
85-
onClick={value => log(value)}
86-
gutterSize={3}
87-
tooltipDataAttrs={customTooltipDataAttrs}
88-
monthLabels={monthLabels}
89-
values={data.records}
90-
classForValue={getClass}
91-
/>
92-
<ReactTooltip
93-
type="error"
94-
effect="solid"
95-
place="top"
96-
id="user_comtribute_map"
97-
/>
98-
<DotWrapper>
99-
<Title>6个月内创作 {data.totalCount} 次内容</Title>
100-
<DotList>
101-
<DotText>潜水&nbsp;&nbsp;</DotText>
102-
<ColorDot scale="empty" />
103-
<ColorDot scale="1" />
104-
<ColorDot scale="2" />
105-
<ColorDot scale="3" />
106-
<ColorDot scale="4" />
107-
<ColorDot scale="5" />
108-
<DotText>&nbsp;高产</DotText>
109-
</DotList>
110-
</DotWrapper>
111-
</Wrapper>
112-
)
113-
}
114100
export default UserContributeMap

0 commit comments

Comments
 (0)