TaskChannelHelper
Helper for task channel definitions
getTemplateForStatus(task, templateHolder, componentType) => string#
Gets template code from task status based template holder
Parameters:
task: ITasktask
templateHolder: TaskStatusBasedType<string>task status based template
componentType: React.ComponentTypecomponent that is calling the method
Returns:
stringtemplate 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: ITasktask
iconHolder: TaskStatusBasedType<(string|React.ReactNode)>task status based icon
byState?: booleanIf icon is based on state
bold?: booleanIf icon is bold
componentType: React.ComponentTypecomponent that is calling the method
Returns:
string | React.ReactNodeicon 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: ITasktask
colorHolder: TaskStatusBasedType<string>task status based template
componentType: React.ComponentTypecomponent that is calling the method
Returns:
stringcolor code
Example:
import { TaskChannelHelper, Badge } from "@twilio/flex-ui";const badgeColor = TaskChannelHelper.getColor(myTask, customColorHolder, Badge);Rate this page