migrated RadarEntry to material-ui styles

This commit is contained in:
Bilawal Hameed
2020-04-24 10:40:54 +02:00
parent 60f4ca9797
commit 6b6d31a556
2 changed files with 22 additions and 20 deletions
@@ -1,16 +0,0 @@
.text {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
pointer-events: none;
user-select: none;
font-size: 9px;
fill: #fff;
text-anchor: middle;
}
.link {
cursor: pointer;
}
@@ -16,9 +16,23 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './RadarEntry.css';
import { withStyles } from '@material-ui/core';
export default class RadarEntry extends React.PureComponent {
const styles = {
text: {
pointerEvents: 'none',
userSelect: 'none',
fontSize: '9px',
fill: '#fff',
textAnchor: 'middle',
},
link: {
cursor: 'pointer',
},
};
class RadarEntry extends React.PureComponent {
render() {
const {
moved,
@@ -30,6 +44,7 @@ export default class RadarEntry extends React.PureComponent {
onMouseEnter,
onMouseLeave,
onClick,
classes,
} = this.props;
const style = { fill: color };
@@ -45,7 +60,7 @@ export default class RadarEntry extends React.PureComponent {
if (url) {
blip = (
<a href={url} className={styles.link}>
<a href={url} className={classes.link}>
{blip}
</a>
);
@@ -59,7 +74,7 @@ export default class RadarEntry extends React.PureComponent {
onClick={onClick}
>
{blip}
<text y={3} className={styles.text}>
<text y={3} className={classes.text}>
{number}
</text>
</g>
@@ -77,4 +92,7 @@ RadarEntry.propTypes = {
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
onClick: PropTypes.func,
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(RadarEntry);