@@ -25,7 +25,7 @@ const log = buildLog('C:Comments')
2525
2626const 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 > 潜水 </ 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 > 高产</ 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 > 潜水 </ 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 > 高产</ DotText >
109- </ DotList >
110- </ DotWrapper >
111- </ Wrapper >
112- )
113- }
114100export default UserContributeMap
0 commit comments