Skip to content

Commit

Permalink
fix: align item icons
Browse files Browse the repository at this point in the history
  • Loading branch information
NeutronicMC committed Nov 19, 2024
1 parent 4be151e commit 742b763
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
26 changes: 16 additions & 10 deletions src/components/checklist/ItemComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ export default function ItemComponent({
}) {
return (
<div className={classNames({ "item-subcomponent": isSubcomponent })}>
<img
className="component-image"
src={getComponentImageUrl(itemName, componentName, component.generic, component.hash)}
alt=""
width="24px"
/>
<span className="component-name">
{component.count.toLocaleString()}x {componentName}
</span>
<div style={{ display: "flex", alignItems: "center", gap: "4px" }}>
<img
className="component-image"
src={getComponentImageUrl(
itemName,
componentName,
component.generic,
component.hash
)}
alt=""
width="24px"
/>
<span className="component-name">
{component.count.toLocaleString()}x {componentName}
</span>
</div>
{component?.components &&
Object.entries(component.components).map(
([subcomponentName, subcomponent]) => {
Expand Down Expand Up @@ -49,4 +56,3 @@ ItemComponent.propTypes = {
component: PropTypes.shape(componentShape).isRequired,
isSubcomponent: PropTypes.bool
};

11 changes: 8 additions & 3 deletions src/components/checklist/ItemRelicTooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ function ItemRelicTooltip({ item, name }) {
const rarity =
relicRarity[relicData.rarity];
return (
<span key={relicName}>
<span
key={relicName}
style={{
display: "flex",
alignItems: "center",
gap: "4px"
}}>
<img
src={`https://cdn.warframestat.us/img/${relicTiers
.find(tier =>
Expand All @@ -39,8 +45,7 @@ function ItemRelicTooltip({ item, name }) {
/>
{relicName} (
<span
className={`relic relic-rarity-${rarity.toLowerCase()}`}
>
className={`relic relic-rarity-${rarity.toLowerCase()}`}>
{rarity}
</span>
)
Expand Down
20 changes: 15 additions & 5 deletions src/components/foundry/MissingIngredients.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,26 @@ function MissingIngredients() {
countA > countB
? -1
: countA < countB
? 1
: nameA.localeCompare(nameB)
? 1
: nameA.localeCompare(nameB)
)
.map(([name, { count, hash }]) => {
return (
<div key={name}>
<div
key={name}
style={{
display: "flex",
alignItems: "center",
gap: "4px"
}}>
<img
className="component-image"
src={getComponentImageUrl("", name, false, hash)}
src={getComponentImageUrl(
"",
name,
false,
hash
)}
alt=""
width="24px"
onDragStart={e => e.preventDefault()}
Expand All @@ -63,4 +74,3 @@ function MissingIngredients() {
}

export default MissingIngredients;

0 comments on commit 742b763

Please sign in to comment.