Skip to content

Commit 2b3caae

Browse files
authored
Merge pull request #14207 from ethereum/walletTableAbstraction-info-icon
Fix: wallet attributes icon alignments
2 parents 209c326 + 4c8e15a commit 2b3caae

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

src/components/FindWalletProductTable/WalletSubComponent.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,26 +91,34 @@ const WalletSubComponent = ({
9191
const featureColor = wallet[item.filterKey]
9292
? "text-body"
9393
: "text-disabled"
94+
// Split last word off filterLabel to force non-wrapping
95+
// connection between the last word and info Tooltip icon
96+
const filterLabelSplit = item.filterLabel.split(" ")
97+
const filterLabelLastWord = filterLabelSplit.pop()
98+
const filterLabelRoot = filterLabelSplit.join(" ")
9499
return (
95100
<li key={idx} className="mb-2 flex flex-row gap-2">
96-
<span>
101+
<span className="translate-y-0.5">
97102
{wallet[item.filterKey] ? (
98-
<GreenCheckProductGlyphIcon className="size-4 text-primary" />
103+
<GreenCheckProductGlyphIcon className="size-4" />
99104
) : (
100-
<WarningProductGlyphIcon className="text-secondary size-4" />
105+
<WarningProductGlyphIcon className="size-4" />
101106
)}
102107
</span>
103-
<p className={`leading-1 ${featureColor}`}>
104-
{item.filterLabel}{" "}
105-
<Tooltip
106-
content={
107-
<p className="text-body">{item.description}</p>
108-
}
109-
>
110-
<span className="whitespace-nowrap">
111-
<MdInfoOutline color={featureColor} />
112-
</span>
113-
</Tooltip>
108+
<p className={cn("leading-1", featureColor)}>
109+
{filterLabelRoot && `${filterLabelRoot} `}
110+
<span className="whitespace-nowrap">
111+
{filterLabelLastWord}
112+
<Tooltip
113+
content={
114+
<p className="text-body">
115+
{item.description}
116+
</p>
117+
}
118+
>
119+
<MdInfoOutline className="ms-1 translate-y-0.5" />
120+
</Tooltip>
121+
</span>
114122
</p>
115123
</li>
116124
)

0 commit comments

Comments
 (0)