Undo hash coloring

This commit is contained in:
Willian Mitsuda 2021-11-26 05:22:08 -03:00
parent 030594ed35
commit 44eec1d2e7
1 changed files with 4 additions and 22 deletions

View File

@ -4,26 +4,8 @@ type HexValueProps = {
value: string;
};
const HexValue: React.FC<HexValueProps> = ({ value }) => {
const shards: string[] = [value.slice(0, 10)];
for (let i = 10; i < value.length; i += 8) {
shards.push(value.slice(i, i + 8));
}
return (
<>
{shards.map((s, i) => (
<span
key={i}
className={`font-hash ${
i % 2 === 0 ? "text-black" : "text-gray-400"
}`}
>
{s}
</span>
))}
</>
const HexValue: React.FC<HexValueProps> = ({ value }) => (
<span className="font-hash text-black">{value}</span>
);
};
export default React.memo(HexValue);
export default HexValue;