Description of icon
Flex UI
API Reference

TaskChannelHelper

Helper for task channel definitions


getTemplateForStatus(task, templateHolder, componentType) => string#

Gets template code from task status based template holder

Parameters:

  • task: ITask

    task

  • templateHolder: TaskStatusBasedType<string>

    task status based template

  • componentType: React.ComponentType

    component that is calling the method

Returns:

  • string

    template code

Example:

import { TaskChannelHelper, Badge } from "@twilio/flex-ui";
const template = TaskChannelHelper.getTemplateForStatus(myTask, customTemplateHolder, Badge);

getIcon(task, iconHolder, byState?, bold?, componentType) => string#

Gets icon from task status based icon holder

Parameters:

  • task: ITask

    task

  • iconHolder: TaskStatusBasedType<(string|React.ReactNode)>

    task status based icon

  • byState?: boolean

    If icon is based on state

  • bold?: boolean

    If icon is bold

  • componentType: React.ComponentType

    component that is calling the method

Returns:

  • string | React.ReactNode

    icon code as string or ReactNode to be rendered as icon

Example:

import { TaskChannelHelper, Badge } from "@twilio/flex-ui";
const Icon = TaskChannelHelper.getIcon(myTask, customIconHolder, Badge);

getColor(task, colorHolder, componentType) => string#

Gets color from task status based color holder

Parameters:

  • task: ITask

    task

  • colorHolder: TaskStatusBasedType<string>

    task status based template

  • componentType: React.ComponentType

    component that is calling the method

Returns:

  • string

    color code

Example:

import { TaskChannelHelper, Badge } from "@twilio/flex-ui";
const badgeColor = TaskChannelHelper.getColor(myTask, customColorHolder, Badge);
Rate this page

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.