Skip to content

chore(UI): update autocomplete no options text #6735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions site/src/components/UserAutocomplete/UserAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AvatarData } from "components/AvatarData/AvatarData"
import debounce from "just-debounce-it"
import { ChangeEvent, FC, useEffect, useState } from "react"
import { searchUserMachine } from "xServices/users/searchUserXService"
import { useTranslation } from "react-i18next"

export type UserAutocompleteProps = {
value: User | null
Expand All @@ -24,6 +25,8 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
className,
}) => {
const styles = useStyles()
const { t } = useTranslation("common")

const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false)
const [searchState, sendSearch] = useMachine(searchUserMachine)
const { searchResults } = searchState.context
Expand All @@ -46,6 +49,7 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({

return (
<Autocomplete
noOptionsText={t("forms.typeToSearch")}
className={className}
options={searchResults}
loading={searchState.matches("searching")}
Expand Down
5 changes: 4 additions & 1 deletion site/src/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
"error": "Coder update check failed."
},
"licenseFieldTextHelper": "You need an enterprise license to use it.",
"learnMore": "Learn more"
"learnMore": "Learn more",
"forms": {
"typeToSearch": "Start typing to search..."
}
}