Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
builder-247 committed Jun 1, 2024
1 parent 53962f3 commit 259ebd0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions src/components/Visualizations/Table/HeroFacet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Facet = styled.div`
position: absolute;
bottom: -4px;
right: 8px;
z-index: 2;
z-index: 10;
border-radius: 1px;
& img {
Expand All @@ -26,6 +26,7 @@ const Facet = styled.div`
.facetTooltip {
display: flex;
flex-direction: column;
z-index: 10;
max-width: 400px;
& .facetHeader {
Expand Down Expand Up @@ -150,12 +151,9 @@ class HeroFacet extends React.Component {
facet
} = this.props;

let selectedFacet = {};

if (heroID && facet) {
selectedFacet = heroAbilities[heroes[heroID].name]?.facets[facet - 1];
}
if (!(heroID && facet)) return null;

const selectedFacet = heroAbilities[heroes[heroID].name]?.facets[facet - 1];
const { color, gradient_id, icon, name } = selectedFacet;

const imageURL = `${config.VITE_IMAGE_CDN}/apps/dota2/images/dota_react/icons/facets/${icon}.png`;
Expand All @@ -164,13 +162,9 @@ class HeroFacet extends React.Component {
return (
<Facet>
<div className={`facet ${colorClass}`} data-tip data-for={name}>
<img
className="facet"
src={imageURL}
alt=""
/>
<img src={imageURL} alt="" />
<div className='hero-tooltip'>
<ReactTooltip id={selectedFacet.name} effect='solid' place='right'>
<ReactTooltip id={name} effect='solid' place='right'>
<div
className={`facetTooltip ${colorClass}`}
style={{
Expand Down
6 changes: 3 additions & 3 deletions src/components/Visualizations/Table/HeroImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const Styled = styled.div`
.abandoned {
position: absolute;
right: 7px;
bottom: 8px;
height: 15px;
Expand Down Expand Up @@ -454,7 +453,7 @@ class TableHeroImage extends React.Component {
party,
heroName,
heroID,
facet = 2, // TODO - remove default
facet,
showGuide,
guideUrl,
guideType,
Expand Down Expand Up @@ -513,13 +512,14 @@ class TableHeroImage extends React.Component {
{leaverStatus !== undefined && leaverStatus > 1 && (
<span
className="abandoned"
style={{ right: facet ? '12px' : '7px' }}
data-hint={strings[`leaver_status_${leaverStatus}`]}
data-hint-position="top"
>
<img src="/assets/images/dota2/disconnect_icon.png" alt="" />
</span>
)}
{(heroID && facet) && <HeroFacet heroID={heroID} facet={facet} />}
<HeroFacet heroID={heroID} facet={facet} />
{playerSlot !== undefined && (
<div
className="playerSlot"
Expand Down

0 comments on commit 259ebd0

Please sign in to comment.