Add facepile to homepage

This commit is contained in:
Robert Long
2021-10-04 15:37:23 -07:00
parent 8da7031b9e
commit 6f2870340a
4 changed files with 64 additions and 2 deletions

24
src/Facepile.jsx Normal file
View File

@@ -0,0 +1,24 @@
import React from "react";
import styles from "./Facepile.module.css";
import ColorHash from "color-hash";
const colorHash = new ColorHash({ lightness: 0.3 });
export function Facepile({ participants }) {
console.log(participants);
return (
<div
className={styles.facepile}
title={participants.map((member) => member.name).join(", ")}
>
{participants.map((member) => (
<div
className={styles.avatar}
style={{ backgroundColor: colorHash.hex(member.name) }}
>
<span>{member.name.slice(0, 1).toUpperCase()}</span>
</div>
))}
</div>
);
}