feat: add css for custom autocomplete

This commit is contained in:
RadoslavDimchev 2023-09-01 15:20:07 +03:00
parent df9c8cc62c
commit 96ca1230fa
2 changed files with 24 additions and 3 deletions

View File

@ -0,0 +1,16 @@
.suggestion-list {
max-height: 100px;
overflow-y: scroll;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.suggestion-item {
padding: 5px;
cursor: pointer;
}
.suggestion-item:hover {
background-color: #f1f1f1;
}

View File

@ -4,6 +4,7 @@ import wordlist from 'web-bip39/wordlists/english'
import { RootState } from '../../../redux/store'
import { setMnemonic, setWord } from '../../../redux/ValidatorOnboarding/KeyGeneration/slice'
import './AutocompleteInput.css'
type AutocompleteInputProps = {
index: number
@ -50,9 +51,13 @@ const AutocompleteInput = ({ index }: AutocompleteInputProps) => {
/>
{isFocused && (
<div className="suggestion-list">
{suggestions.map(s => (
<div key={s} className="suggestion-item" onClick={() => handleSuggestionClick(s)}>
{s}
{suggestions.map(suggestion => (
<div
key={suggestion}
className="suggestion-item"
onClick={() => handleSuggestionClick(suggestion)}
>
{suggestion}
</div>
))}
</div>