mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-12-22 16:37:44 +00:00
fix: show placeholder select while waiting for load
This commit is contained in:
parent
f38dfb5604
commit
ea6ad52a73
@ -219,6 +219,7 @@ export const Select = ({
|
||||
getItemProps,
|
||||
openMenu,
|
||||
} = useCombobox({
|
||||
defaultInputValue: (options[0] as unknown as SelectOption)?.value,
|
||||
items: filteredItems,
|
||||
selectedItem: multiple ? null : (value as SelectOption) || null,
|
||||
// @ts-expect-error – there are two params but we don't need the second one
|
||||
|
@ -143,24 +143,29 @@ const CreateRepo = () => {
|
||||
The project will be cloned into this repository
|
||||
</Heading>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col justify-start gap-3">
|
||||
<span className="text-sm text-elements-high-em">Git account</span>
|
||||
<Controller
|
||||
name="account"
|
||||
control={control}
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<Select
|
||||
value={{ value } as SelectOption}
|
||||
onChange={(value) => onChange((value as SelectOption).value)}
|
||||
options={
|
||||
gitAccounts.map((account) => ({
|
||||
value: account,
|
||||
label: account,
|
||||
})) ?? []
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
{gitAccounts.length > 0 ? (
|
||||
<Controller
|
||||
name="account"
|
||||
control={control}
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<Select
|
||||
value={{ value } as SelectOption}
|
||||
onChange={(value) => onChange((value as SelectOption).value)}
|
||||
options={
|
||||
gitAccounts.map((account) => ({
|
||||
value: account,
|
||||
label: account,
|
||||
})) ?? []
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
) : (
|
||||
<Select options={[]} disabled />
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col justify-start gap-3">
|
||||
<span className="text-sm text-elements-high-em">Name the repo</span>
|
||||
|
Loading…
Reference in New Issue
Block a user