ungrayscale if connected

This commit is contained in:
talksik
2022-05-07 15:25:06 -05:00
parent 5459e2fd2b
commit a1e13267cb
3 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ async function createLine(req: Request, res: Response) {
const newLine = new Line( const newLine = new Line(
new ObjectId(userInfo.userId), new ObjectId(userInfo.userId),
reqObj.lineName, reqObj.lineName ?? undefined,
new Date(), new Date(),
new Date(), new Date(),
new ObjectId() new ObjectId()
@@ -1,6 +1,12 @@
import { Avatar } from "antd"; import { Avatar } from "antd";
export default function LineIcon({ sourceImages }: { sourceImages: string[] }) { export default function LineIcon({
sourceImages,
grayscale = true,
}: {
sourceImages: string[];
grayscale: boolean;
}) {
return ( return (
<Avatar.Group <Avatar.Group
maxCount={2} maxCount={2}
@@ -20,7 +26,7 @@ export default function LineIcon({ sourceImages }: { sourceImages: string[] }) {
src={avatarSrc} src={avatarSrc}
shape="square" shape="square"
size={"default"} size={"default"}
className={"grayscale"} className={`${grayscale && "grayscale"}`}
/> />
))} ))}
</Avatar.Group> </Avatar.Group>
@@ -142,7 +142,9 @@ export default function LineRow({
{renderActivityIcon} {renderActivityIcon}
<span className="flex flex-row gap-2 items-center justify-start text-slate-800"> <span className="flex flex-row gap-2 items-center justify-start text-slate-800">
{profilePictures && <LineIcon sourceImages={profilePictures} />} {profilePictures && (
<LineIcon grayscale={!isUserTunedIn} sourceImages={profilePictures} />
)}
<h2 <h2
className={`text-inherit text-md truncate ${ className={`text-inherit text-md truncate ${
@@ -151,7 +153,8 @@ export default function LineRow({
: "" : ""
}`} }`}
> >
{masterLineData.lineDetails.name} {masterLineData.lineDetails.name ||
masterLineData.otherUserObjects[0].givenName}
</h2> </h2>
</span> </span>