Skip to content

Commit

Permalink
fix: 优化情绪格子的样式
Browse files Browse the repository at this point in the history
  • Loading branch information
airingursb committed Jan 13, 2019
1 parent 9aec313 commit fcea3e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file not shown.
5 changes: 3 additions & 2 deletions src/containers/profile/ProfileMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export default class ProfileMode extends Component {
calendarHeatMapValue.push(heatmapValue)
}

// 单独 setState 是为了保证情绪格子的数目能先于数据确定下来,避免渲染错误
this.setState({
numDays: Math.ceil((Date.now() - startTime) / (24 * 60 * 60 * 1000)) < 240 ? 240 : Math.ceil((Date.now() - startTime) / (24 * 60 * 60 * 1000)),
})
Expand Down Expand Up @@ -609,8 +610,8 @@ const styles = StyleSheet.create({
heatmap_container: {
flexDirection: 'row',
alignItems: 'center',
// width: 0.95 * WIDTH,
// marginLeft: 0.04 * WIDTH,
marginLeft: 0.04 * WIDTH,
marginRight: 0.04 * WIDTH,
marginTop: getResponsiveWidth(24)
},
total_container: {
Expand Down

0 comments on commit fcea3e5

Please sign in to comment.