mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-06 02:57:27 +02:00
🐛 Switch to icon for YouAvatar
This commit is contained in:
parent
a6bb357acc
commit
c4b9edf297
2 changed files with 6 additions and 8 deletions
|
@ -1,11 +1,12 @@
|
||||||
import { useTranslation } from "@/app/i18n/client";
|
import { Icon } from "@rallly/ui/icon";
|
||||||
|
import { UserIcon } from "lucide-react";
|
||||||
|
|
||||||
export function YouAvatar() {
|
export function YouAvatar() {
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="inline-flex size-5 items-center justify-center rounded-full bg-gray-200 text-xs font-medium">
|
<div className="inline-flex size-5 items-center justify-center rounded-full bg-gray-200 text-xs font-medium">
|
||||||
{t("you")[0]}
|
<Icon>
|
||||||
|
<UserIcon />
|
||||||
|
</Icon>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,13 +49,10 @@ const colorPairs = [
|
||||||
{ bg: "#EBE6FF", text: "#4800BD" }, // Light indigo
|
{ bg: "#EBE6FF", text: "#4800BD" }, // Light indigo
|
||||||
];
|
];
|
||||||
|
|
||||||
export function getColor(seed?: string): {
|
export function getColor(seed: string): {
|
||||||
bgColor: string;
|
bgColor: string;
|
||||||
textColor: string;
|
textColor: string;
|
||||||
} {
|
} {
|
||||||
if (!seed) {
|
|
||||||
return { bgColor: "#E6F4FF", textColor: "#0065BD" };
|
|
||||||
}
|
|
||||||
let hash = 0;
|
let hash = 0;
|
||||||
for (let i = 0; i < seed.length; i++) {
|
for (let i = 0; i < seed.length; i++) {
|
||||||
hash = seed.charCodeAt(i) + ((hash << 5) - hash);
|
hash = seed.charCodeAt(i) + ((hash << 5) - hash);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue