Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELEASE] 2023-06-17 #3105

Merged
merged 7 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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