From 932e4c3343947a35ba26938e1b5113b079dd4519 Mon Sep 17 00:00:00 2001 From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:35:48 -0700 Subject: [PATCH] Use call link color in create, update, show --- ts/components/CallLinkAddNameModal.tsx | 2 ++ ts/components/CallLinkDetails.tsx | 2 ++ ts/components/CallLinkEditModal.tsx | 2 ++ ts/components/CallingAdhocCallInfo.tsx | 4 ++-- ts/types/Colors.ts | 2 ++ ts/util/callLinks.ts | 17 +---------------- ts/util/getColorForCallLink.ts | 20 ++++++++++++++++++++ ts/util/migrateColor.ts | 4 ++-- 8 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 ts/util/getColorForCallLink.ts diff --git a/ts/components/CallLinkAddNameModal.tsx b/ts/components/CallLinkAddNameModal.tsx index 19735c76bd3..7b817a55e9a 100644 --- a/ts/components/CallLinkAddNameModal.tsx +++ b/ts/components/CallLinkAddNameModal.tsx @@ -8,6 +8,7 @@ import { Button, ButtonVariant } from './Button'; import { Avatar, AvatarSize } from './Avatar'; import { Input } from './Input'; import type { CallLinkType } from '../types/CallLink'; +import { getColorForCallLink } from '../util/getColorForCallLink'; export type CallLinkAddNameModalProps = Readonly<{ i18n: LocalizerType; @@ -68,6 +69,7 @@ export function CallLinkAddNameModal({ { const colorIndex = participant.serviceId ? (parseInt(participant.serviceId.slice(-4), 16) || 0) % - AvatarColors.length + AVATAR_COLOR_COUNT : 0; return (