🚸 Add a better select input
Also improves other inputs behavior
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CodeEditor } from '@/components/CodeEditor'
|
||||
import { CodeEditor } from '@/components/inputs/CodeEditor'
|
||||
import React from 'react'
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { Text, HStack } from '@chakra-ui/react'
|
||||
import { SearchableDropdown } from '@/components/SearchableDropdown'
|
||||
import { env, isEmpty } from 'utils'
|
||||
import { AutocompleteInput } from '@/components/inputs/AutocompleteInput'
|
||||
|
||||
type FontSelectorProps = {
|
||||
activeFont?: string
|
||||
@@ -32,7 +32,7 @@ export const FontSelector = ({
|
||||
}
|
||||
|
||||
const handleFontSelected = (nextFont: string) => {
|
||||
if (nextFont == currentFont) return
|
||||
if (nextFont === currentFont) return
|
||||
setCurrentFont(nextFont)
|
||||
onSelectFont(nextFont)
|
||||
}
|
||||
@@ -40,10 +40,11 @@ export const FontSelector = ({
|
||||
return (
|
||||
<HStack justify="space-between" align="center">
|
||||
<Text>Font</Text>
|
||||
<SearchableDropdown
|
||||
selectedItem={activeFont}
|
||||
<AutocompleteInput
|
||||
defaultValue={activeFont}
|
||||
items={googleFonts}
|
||||
onValueChange={handleFontSelected}
|
||||
onChange={handleFontSelected}
|
||||
withVariableButton={false}
|
||||
/>
|
||||
</HStack>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user