-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: failed to establish a connection with the upstream server #263
Changes from all commits
2ccdd28
cf8d72f
ed017f4
5b91ccf
e7876e3
f6a94a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Flex, TextField, Button } from '@radix-ui/themes' | ||
import { FieldGroup } from './FieldGroup' | ||
import { Controller, FieldErrors } from 'react-hook-form' | ||
|
||
type FileUploadInputProps = { | ||
name: string | ||
label: string | ||
buttonText: string | ||
hint?: string | ||
errors?: FieldErrors | ||
onSelectFile: () => void | ||
} | ||
|
||
export const FileUploadInput = ({ | ||
onSelectFile, | ||
name, | ||
hint, | ||
label, | ||
errors, | ||
buttonText, | ||
}: FileUploadInputProps) => { | ||
return ( | ||
<Flex> | ||
<Controller | ||
name={name} | ||
render={({ field }) => ( | ||
<FieldGroup | ||
flexGrow="1" | ||
name={name} | ||
label={label} | ||
errors={errors ?? {}} | ||
hint={hint} | ||
hintType="text" | ||
> | ||
<TextField.Root | ||
type="text" | ||
onChange={field.onChange} | ||
name={field.name} | ||
value={field.value} | ||
/> | ||
</FieldGroup> | ||
)} | ||
/> | ||
|
||
<Button | ||
ml="2" | ||
onClick={onSelectFile} | ||
style={{ | ||
marginTop: 48, | ||
}} | ||
> | ||
{buttonText} | ||
</Button> | ||
</Flex> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './FieldError' | ||
export * from './FieldGroup' | ||
export * from './ControlledSelect' | ||
export * from './FileUploadInput' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,10 +50,6 @@ export const SettingsDialog = ({ open, onOpenChange }: SettingsDialogProps) => { | |
} | ||
} | ||
|
||
const handleCancelClick = () => { | ||
reset(settings) | ||
} | ||
|
||
return ( | ||
<Dialog.Root open={open} onOpenChange={onOpenChange}> | ||
<Dialog.Content | ||
|
@@ -72,9 +68,7 @@ export const SettingsDialog = ({ open, onOpenChange }: SettingsDialogProps) => { | |
|
||
<Flex gap="3" justify="end"> | ||
<Dialog.Close> | ||
<Button variant="outline" onClick={handleCancelClick}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@Llandy3d there was a leftover logic from when Settings was still a page and the form state needed to be reset. This should fix the issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It did 🥳 |
||
Cancel | ||
</Button> | ||
<Button variant="outline">Cancel</Button> | ||
</Dialog.Close> | ||
<Dialog.Close> | ||
<ButtonWithTooltip | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted this file into its own component so it can be reused for the recorder's Browser Path as well