build: 👷 New compose file and entrypoints
This commit is contained in:
@ -14,14 +14,15 @@ import { DividerWithText } from './DividerWithText'
|
||||
import { SocialLoginButtons } from './SocialLoginButtons'
|
||||
import { useRouter } from 'next/router'
|
||||
import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
const hasNoAuthProvider =
|
||||
(!process.env.NEXT_PUBLIC_SMTP_FROM ||
|
||||
(isEmpty(process.env.NEXT_PUBLIC_SMTP_FROM) ||
|
||||
process.env.NEXT_PUBLIC_SMTP_AUTH_DISABLED === 'true') &&
|
||||
!process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID &&
|
||||
!process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID &&
|
||||
!process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID &&
|
||||
!process.env.NEXT_PUBLIC_GITLAB_CLIENT_ID
|
||||
isEmpty(process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID) &&
|
||||
isEmpty(process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID) &&
|
||||
isEmpty(process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID) &&
|
||||
isEmpty(process.env.NEXT_PUBLIC_GITLAB_CLIENT_ID)
|
||||
|
||||
type Props = {
|
||||
defaultEmail?: string
|
||||
@ -77,7 +78,7 @@ export const SignInForm = ({
|
||||
return (
|
||||
<Stack spacing="4" w="330px">
|
||||
<SocialLoginButtons />
|
||||
{process.env.NEXT_PUBLIC_SMTP_FROM &&
|
||||
{!isEmpty(process.env.NEXT_PUBLIC_SMTP_FROM) &&
|
||||
process.env.NEXT_PUBLIC_SMTP_AUTH_DISABLED !== 'true' && (
|
||||
<>
|
||||
<DividerWithText mt="6">Or with your email</DividerWithText>
|
||||
|
@ -5,6 +5,7 @@ import { useRouter } from 'next/router'
|
||||
import React from 'react'
|
||||
import { stringify } from 'qs'
|
||||
import { FacebookLogo, GoogleLogo, GitlabLogo } from 'assets/logos'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
export const SocialLoginButtons = () => {
|
||||
const { query } = useRouter()
|
||||
@ -32,7 +33,7 @@ export const SocialLoginButtons = () => {
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
{process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID && (
|
||||
{!isEmpty(process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID) && (
|
||||
<Button
|
||||
leftIcon={<GithubIcon />}
|
||||
onClick={handleGitHubClick}
|
||||
@ -43,7 +44,7 @@ export const SocialLoginButtons = () => {
|
||||
Continue with GitHub
|
||||
</Button>
|
||||
)}
|
||||
{process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID && (
|
||||
{!isEmpty(process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID) && (
|
||||
<Button
|
||||
leftIcon={<GoogleLogo />}
|
||||
onClick={handleGoogleClick}
|
||||
@ -54,7 +55,7 @@ export const SocialLoginButtons = () => {
|
||||
Continue with Google
|
||||
</Button>
|
||||
)}
|
||||
{process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID && (
|
||||
{!isEmpty(process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID) && (
|
||||
<Button
|
||||
leftIcon={<FacebookLogo />}
|
||||
onClick={handleFacebookClick}
|
||||
@ -65,7 +66,7 @@ export const SocialLoginButtons = () => {
|
||||
Continue with Facebook
|
||||
</Button>
|
||||
)}
|
||||
{process.env.NEXT_PUBLIC_GITLAB_CLIENT_ID && (
|
||||
{!isEmpty(process.env.NEXT_PUBLIC_GITLAB_CLIENT_ID) && (
|
||||
<Button
|
||||
leftIcon={<GitlabLogo />}
|
||||
onClick={handleGitlabClick}
|
||||
@ -73,7 +74,10 @@ export const SocialLoginButtons = () => {
|
||||
isLoading={['loading', 'authenticated'].includes(status)}
|
||||
variant="outline"
|
||||
>
|
||||
Continue with {process.env.NEXT_PUBLIC_GITLAB_NAME || 'GitLab'}
|
||||
Continue with{' '}
|
||||
{isEmpty(process.env.NEXT_PUBLIC_GITLAB_NAME)
|
||||
? 'GitLab'
|
||||
: process.env.NEXT_PUBLIC_GITLAB_NAME}
|
||||
</Button>
|
||||
)}
|
||||
</Stack>
|
||||
|
@ -5,6 +5,7 @@ import { BubbleParams } from 'typebot-js'
|
||||
import { parseInitBubbleCode, typebotJsHtml } from '../params'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type ChatEmbedCodeProps = {
|
||||
withStarterVariables?: boolean
|
||||
@ -20,8 +21,9 @@ export const ChatEmbedCode = ({
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
|
@ -5,6 +5,7 @@ import { parseInitContainerCode, typebotJsHtml } from '../params'
|
||||
import { IframeParams } from 'typebot-js'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type ContainerEmbedCodeProps = {
|
||||
widthLabel: string
|
||||
@ -22,8 +23,9 @@ export const ContainerEmbedCode = ({
|
||||
const snippet = prettier.format(
|
||||
parseSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { FlexProps } from '@chakra-ui/react'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type Props = {
|
||||
widthLabel: string
|
||||
@ -13,8 +14,9 @@ export const IframeEmbedCode = ({
|
||||
}: Props & FlexProps) => {
|
||||
const { typebot } = useTypebot()
|
||||
const src = `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`
|
||||
const code = `<iframe src="${src}" width="${widthLabel}" height="${heightLabel}" />`
|
||||
|
||||
|
@ -4,6 +4,7 @@ import { useTypebot } from 'contexts/TypebotContext'
|
||||
import parserHtml from 'prettier/parser-html'
|
||||
import prettier from 'prettier/standalone'
|
||||
import { PopupParams } from 'typebot-js'
|
||||
import { isEmpty } from 'utils'
|
||||
import { parseInitPopupCode, typebotJsHtml } from '../params'
|
||||
|
||||
type PopupEmbedCodeProps = {
|
||||
@ -17,8 +18,9 @@ export const PopupEmbedCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const snippet = prettier.format(
|
||||
createSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
delay,
|
||||
}),
|
||||
|
@ -10,6 +10,7 @@ import parserBabel from 'prettier/parser-babel'
|
||||
import prettier from 'prettier/standalone'
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type StandardReactDivProps = { widthLabel: string; heightLabel: string }
|
||||
export const StandardReactDiv = ({
|
||||
@ -20,8 +21,9 @@ export const StandardReactDiv = ({
|
||||
const snippet = prettier.format(
|
||||
parseContainerSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
heightLabel,
|
||||
widthLabel,
|
||||
@ -71,8 +73,9 @@ export const PopupReactCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
|
||||
const snippet = prettier.format(
|
||||
parsePopupSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
delay,
|
||||
}),
|
||||
@ -121,8 +124,9 @@ export const ChatReactCode = ({
|
||||
const snippet = prettier.format(
|
||||
parseBubbleSnippet({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${typebot?.publicId}`,
|
||||
button,
|
||||
proactiveMessage,
|
||||
|
@ -18,6 +18,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { createCustomDomain } from 'services/user'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
const hostnameRegex =
|
||||
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/
|
||||
@ -119,8 +120,11 @@ export const CustomDomainModal = ({
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Text fontWeight="bold">Value</Text>
|
||||
<Text>{process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL}</Text>
|
||||
<Text>
|
||||
{isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL}
|
||||
</Text>
|
||||
</Stack>
|
||||
</HStack>
|
||||
) : (
|
||||
|
@ -11,6 +11,7 @@ import { PopupEmbedSettings } from 'components/share/codeSnippets/Popup/EmbedSet
|
||||
import { CodeEditor } from 'components/shared/CodeEditor'
|
||||
import { useState } from 'react'
|
||||
import { BubbleParams } from 'typebot-js'
|
||||
import { isEmpty } from 'utils'
|
||||
import { ModalProps } from '../../EmbedButton'
|
||||
|
||||
type GtmInstructionsProps = {
|
||||
@ -40,8 +41,9 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`,
|
||||
})
|
||||
const headCode = `${typebotJsHtml}
|
||||
|
@ -16,6 +16,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { CopyButton } from 'components/shared/buttons/CopyButton'
|
||||
import { PublishFirstInfo } from 'components/shared/Info'
|
||||
import { isEmpty } from 'utils'
|
||||
import { ModalProps } from '../EmbedButton'
|
||||
|
||||
export const NotionModal = ({
|
||||
@ -45,15 +46,17 @@ export const NotionModal = ({
|
||||
pr="4.5rem"
|
||||
type={'text'}
|
||||
defaultValue={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
<InputRightElement width="4.5rem">
|
||||
<CopyButton
|
||||
textToCopy={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
</InputRightElement>
|
||||
|
@ -14,6 +14,7 @@ import { BubbleParams } from 'typebot-js'
|
||||
import { ModalProps } from '../../EmbedButton'
|
||||
import parserHtml from 'prettier/parser-html'
|
||||
import prettier from 'prettier/standalone'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type ShopifyInstructionsProps = {
|
||||
type: 'standard' | 'popup' | 'bubble'
|
||||
@ -45,8 +46,9 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
|
||||
|
||||
const jsCode = parseInitContainerCode({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`,
|
||||
})
|
||||
const headCode = prettier.format(
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
import { ExternalLinkIcon } from 'assets/icons'
|
||||
import { CopyButton } from 'components/shared/buttons/CopyButton'
|
||||
import { PublishFirstInfo } from 'components/shared/Info'
|
||||
import { isEmpty } from 'utils'
|
||||
import { ModalProps } from '../EmbedButton'
|
||||
|
||||
export const WordpressModal = ({
|
||||
@ -54,15 +55,17 @@ export const WordpressModal = ({
|
||||
pr="4.5rem"
|
||||
type={'text'}
|
||||
defaultValue={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
<InputRightElement width="4.5rem">
|
||||
<CopyButton
|
||||
textToCopy={`${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/${publicId}`}
|
||||
/>
|
||||
</InputRightElement>
|
||||
|
@ -9,6 +9,7 @@ import { useDebouncedCallback } from 'use-debounce'
|
||||
import { linter } from '@codemirror/lint'
|
||||
import { VariablesButton } from './buttons/VariablesButton'
|
||||
import { Variable } from 'models'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
const linterExtension = linter(jsonParseLinter())
|
||||
|
||||
@ -40,7 +41,7 @@ export const CodeEditor = ({
|
||||
setPlainTextValue(value)
|
||||
onChange && onChange(value)
|
||||
},
|
||||
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
|
||||
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
|
||||
)
|
||||
|
||||
useEffect(
|
||||
|
@ -16,6 +16,7 @@ import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { BaseEmoji, emojiIndex } from 'emoji-mart'
|
||||
import { emojis } from './emojis'
|
||||
import { Input } from '../Textbox/Input'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type Props = {
|
||||
url?: string
|
||||
@ -182,7 +183,7 @@ const EmojiContent = ({
|
||||
}
|
||||
|
||||
const GiphyContent = ({ onNewUrl }: ContentProps) => {
|
||||
if (!process.env.NEXT_PUBLIC_GIPHY_API_KEY)
|
||||
if (isEmpty(process.env.NEXT_PUBLIC_GIPHY_API_KEY))
|
||||
return <Text>NEXT_PUBLIC_GIPHY_API_KEY is missing in environment</Text>
|
||||
return (
|
||||
<SearchContextManager
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { useState, useRef, useEffect, ChangeEvent } from 'react'
|
||||
import { useDebouncedCallback } from 'use-debounce'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type Props = {
|
||||
selectedItem?: string
|
||||
@ -31,7 +32,7 @@ export const SearchableDropdown = ({
|
||||
const debounced = useDebouncedCallback(
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
onValueChange ? onValueChange : () => {},
|
||||
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
|
||||
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
|
||||
)
|
||||
const [filteredItems, setFilteredItems] = useState([
|
||||
...items
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useDebouncedCallback } from 'use-debounce'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
export const SmartNumberInput = ({
|
||||
value,
|
||||
@ -22,7 +23,7 @@ export const SmartNumberInput = ({
|
||||
const [currentValue, setCurrentValue] = useState(value?.toString() ?? '')
|
||||
const debounced = useDebouncedCallback(
|
||||
onValueChange,
|
||||
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
|
||||
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
|
||||
)
|
||||
|
||||
useEffect(
|
||||
|
@ -5,6 +5,7 @@ import React, { useEffect, useState } from 'react'
|
||||
import { isCloudProdInstance } from 'services/utils'
|
||||
import { planToReadable } from 'services/workspace'
|
||||
import { initBubble } from 'typebot-js'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
export const SupportBubble = () => {
|
||||
const { typebot } = useTypebot()
|
||||
@ -22,8 +23,9 @@ export const SupportBubble = () => {
|
||||
setLocalUserId(user?.id)
|
||||
initBubble({
|
||||
url: `${
|
||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||
process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
|
||||
? process.env.NEXT_PUBLIC_VIEWER_URL
|
||||
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
|
||||
}/typebot-support`,
|
||||
backgroundColor: '#ffffff',
|
||||
button: {
|
||||
|
@ -7,6 +7,7 @@ import {
|
||||
import { Variable } from 'models'
|
||||
import React, { ChangeEvent, useEffect, useRef, useState } from 'react'
|
||||
import { useDebouncedCallback } from 'use-debounce'
|
||||
import { isEmpty } from 'utils'
|
||||
import { VariablesButton } from '../buttons/VariablesButton'
|
||||
|
||||
export type TextBoxProps = {
|
||||
@ -35,7 +36,7 @@ export const TextBox = ({
|
||||
(value) => {
|
||||
onChange(value)
|
||||
},
|
||||
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
|
||||
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -17,7 +17,7 @@ import cuid from 'cuid'
|
||||
import { Variable } from 'models'
|
||||
import React, { useState, useRef, ChangeEvent, useEffect } from 'react'
|
||||
import { useDebouncedCallback } from 'use-debounce'
|
||||
import { byId, isNotDefined } from 'utils'
|
||||
import { byId, isEmpty, isNotDefined } from 'utils'
|
||||
|
||||
type Props = {
|
||||
initialVariableId?: string
|
||||
@ -47,7 +47,7 @@ export const VariableSearchInput = ({
|
||||
const variable = variables.find((v) => v.name === value)
|
||||
if (variable) onSelectVariable(variable)
|
||||
},
|
||||
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
|
||||
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
|
||||
)
|
||||
const [filteredItems, setFilteredItems] = useState<Variable[]>(
|
||||
variables ?? []
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { Text, HStack } from '@chakra-ui/react'
|
||||
import { SearchableDropdown } from '../../../shared/SearchableDropdown'
|
||||
import { isEmpty } from 'utils'
|
||||
|
||||
type FontSelectorProps = {
|
||||
activeFont?: string
|
||||
@ -19,7 +20,7 @@ export const FontSelector = ({
|
||||
}, [])
|
||||
|
||||
const fetchPopularFonts = async () => {
|
||||
if (!process.env.NEXT_PUBLIC_GOOGLE_API_KEY) return []
|
||||
if (isEmpty(process.env.NEXT_PUBLIC_GOOGLE_API_KEY)) return []
|
||||
const response = await fetch(
|
||||
`https://www.googleapis.com/webfonts/v1/webfonts?key=${process.env.NEXT_PUBLIC_GOOGLE_API_KEY}&sort=popularity`
|
||||
)
|
||||
|
Reference in New Issue
Block a user