2
0

(setVariable) Add "Moment of the day" variable value

Closes #564
This commit is contained in:
Baptiste Arnaud
2023-06-15 14:45:42 +02:00
parent fbe63aa3f3
commit d8c1a36bc0
6 changed files with 41 additions and 7 deletions

View File

@@ -42,6 +42,7 @@ const getExpression =
case 'Today':
case 'Tomorrow':
case 'User ID':
case 'Moment of the day':
case 'Yesterday': {
return `${variableName} = ${options.type}`
}

View File

@@ -1,4 +1,4 @@
import { FormLabel, Stack, Text } from '@chakra-ui/react'
import { Alert, AlertIcon, FormLabel, Stack, Tag, Text } from '@chakra-ui/react'
import { CodeEditor } from '@/components/inputs/CodeEditor'
import { SetVariableOptions, Variable, valueTypes } from '@typebot.io/schemas'
import React from 'react'
@@ -131,6 +131,18 @@ const SetVariableValue = ({
</Stack>
)
}
case 'Moment of the day': {
return (
<Alert fontSize="sm">
<AlertIcon />
<Text>
Will return either <Tag size="sm">morning</Tag>,{' '}
<Tag size="sm">afternoon</Tag>,<Tag size="sm">evening</Tag> or{' '}
<Tag size="sm">night</Tag> based on the current user time.
</Text>
</Alert>
)
}
case 'Random ID':
case 'Today':
case 'Tomorrow':