diff --git a/next-tavla/src/Board/utils/colors.ts b/next-tavla/src/Board/utils/colors.ts deleted file mode 100644 index 4aa9bcbe1..000000000 --- a/next-tavla/src/Board/utils/colors.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { TPresentation, TTransportMode } from 'types/graphql-schema' - -export type TColors = { backgroundColor: string; color: string } - -const thirdPartyColors: Record = { - 'RUT:Line:1': { - backgroundColor: '#0073db', - color: '#fff', - }, - 'RUT:Line:2': { - backgroundColor: '#ec700c', - color: '#fff', - }, - 'RUT:Line:3': { - backgroundColor: '#a85fa5', - color: '#fff', - }, - 'RUT:Line:4': { - backgroundColor: '#004a98', - color: '#fff', - }, - 'RUT:Line:5': { - backgroundColor: '#32aa35', - color: '#fff', - }, -} - -export function getPresentation( - presentation: TPresentation | null, - id: string, - transportMode: TTransportMode | null, -): TColors { - const customBackgroundColor = thirdPartyColors[id] - if (customBackgroundColor) return customBackgroundColor - - const presentationBackgroundColor = presentation?.colour - ? `#${presentation.colour}` - : null - - const defaultBackgroundColor = `var(--table-transport-${transportMode}-color)` - - const color = presentation?.textColour - ? `#${presentation.textColour}` - : 'var(--main-background-color)' - - return { - backgroundColor: presentationBackgroundColor ?? defaultBackgroundColor, - color, - } -}