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