Skip to content

Commit

Permalink
Merge pull request #3105 from odota/master
Browse files Browse the repository at this point in the history
[RELEASE] 2023-06-17
  • Loading branch information
howardchung committed Jun 17, 2023
2 parents 3767199 + fd0676c commit cf76959
Show file tree
Hide file tree
Showing 14 changed files with 470 additions and 263 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT",
"scripts": {
"start": "react-scripts start",
"start:node17": "react-scripts --openssl-legacy-provider start",
"start:install": "npm install && npm run lint && npm run start",
"build": "react-scripts build",
"build:install": "npm install && npm run lint && npm run build",
Expand Down Expand Up @@ -115,4 +116,4 @@
"not ie <= 11",
"not op_mini all"
]
}
}
Binary file added public/assets/images/dota2/map/detailed_733.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/dota2/map/detailed_733.webp
Binary file not shown.
7 changes: 2 additions & 5 deletions src/components/DotaMap/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import patch from 'dotaconstants/build/patch.json';
import { patchDate } from '../../utility';

const setMapSizeStyle = (width, maxWidth) => ({
width,
Expand All @@ -11,6 +11,7 @@ const setMapSizeStyle = (width, maxWidth) => ({
});

const dotaMaps = [
{ patch: '7.33', images: { jpg: '/assets/images/dota2/map/detailed_733.jpg', webp: '/assets/images/dota2/map/detailed_733.webp' } },
{ patch: '7.32', images: { jpg: '/assets/images/dota2/map/detailed_732.jpg', webp: '/assets/images/dota2/map/detailed_732.webp' } },
{ patch: '7.23', images: { jpg: '/assets/images/dota2/map/detailed_723.jpg', webp: '/assets/images/dota2/map/detailed_723.webp' } },
{ patch: '7.20', images: { jpg: '/assets/images/dota2/map/detailed_720.jpg', webp: '/assets/images/dota2/map/detailed_720.webp' } },
Expand All @@ -21,10 +22,6 @@ const dotaMaps = [
{ patch: '6.70', images: { jpg: '/assets/images/dota2/map/detailed_pre682.jpg', webp: '/assets/images/dota2/map/detailed_pre682.webp' } },
];

const patchDate = {};
patch.forEach((patchElement) => {
patchDate[patchElement.name] = new Date(patchElement.date).getTime() / 1000;
});

const getPatchMap = (startTime) => {
if (!startTime) return dotaMaps[0];
Expand Down
4 changes: 3 additions & 1 deletion src/components/Heatmap/Heatmap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Heatmap extends Component {

static propTypes = {
width: PropTypes.number,
startTime: PropTypes.instanceOf(Date)
}

componentDidMount() {
Expand All @@ -60,13 +61,14 @@ class Heatmap extends Component {
}}
id={this.id}
>
<DotaMap width={this.props.width} maxWidth={this.props.width} />
<DotaMap width={this.props.width} maxWidth={this.props.width} startTime={this.props.startTime} />
</div>);
}
}

Heatmap.defaultProps = {
width: 600,
startTime: null
};

export default Heatmap;
Loading

0 comments on commit cf76959

Please sign in to comment.