Undo hash coloring
This commit is contained in:
parent
030594ed35
commit
44eec1d2e7
|
@ -4,26 +4,8 @@ type HexValueProps = {
|
||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const HexValue: React.FC<HexValueProps> = ({ value }) => {
|
const HexValue: React.FC<HexValueProps> = ({ value }) => (
|
||||||
const shards: string[] = [value.slice(0, 10)];
|
<span className="font-hash text-black">{value}</span>
|
||||||
for (let i = 10; i < value.length; i += 8) {
|
);
|
||||||
shards.push(value.slice(i, i + 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
export default HexValue;
|
||||||
<>
|
|
||||||
{shards.map((s, i) => (
|
|
||||||
<span
|
|
||||||
key={i}
|
|
||||||
className={`font-hash ${
|
|
||||||
i % 2 === 0 ? "text-black" : "text-gray-400"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{s}
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default React.memo(HexValue);
|
|
||||||
|
|
Loading…
Reference in New Issue