Skip to content

Commit

Permalink
fixup! Add Kado OTC provider
Browse files Browse the repository at this point in the history
  • Loading branch information
samholmes committed Nov 29, 2024
1 parent 5bef9d4 commit b200979
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/plugins/gui/scenes/EmailFormScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useHandler } from '../../../hooks/useHandler'
import { lstrings } from '../../../locales/strings'
import { BuyTabSceneProps } from '../../../types/routerTypes'
import { GuiFormField } from '../components/GuiFormField'
import { useFormFieldState } from '../hooks/useFormFieldState'

export interface FiatPluginEmailFormParams {
message?: string
Expand All @@ -24,7 +23,7 @@ export const EmailFormScene = React.memo((props: Props) => {
const { params } = route
const { onClose, onSubmit } = params

const emailField = useFormFieldState()
const [email, setEmail] = React.useState('')

React.useEffect(() => {
return navigation.addListener('beforeRemove', () => {
Expand All @@ -36,17 +35,17 @@ export const EmailFormScene = React.memo((props: Props) => {
if (navigation.canGoBack()) navigation.goBack()
})
const handleSubmitPress = useHandler(async () => {
await onSubmit(emailField.value)
await onSubmit(email)
})

return (
<SceneWrapper hasTabs hasNotifications avoidKeyboard scroll>
<SceneContainer>
<SceneHeaderUi4 title="Enter Email" />
{params.message == null ? null : <Paragraph>{params.message}</Paragraph>}
<GuiFormField fieldType="text" autofocus label={lstrings.form_field_title_email_address} {...emailField} />
<GuiFormField fieldType="text" autofocus label={lstrings.form_field_title_email_address} onChangeText={setEmail} value={email} />
<SceneButtons
primary={{ label: lstrings.submit, disabled: emailField.value === '', onPress: handleSubmitPress }}
primary={{ label: lstrings.submit, disabled: email === '', onPress: handleSubmitPress }}
tertiary={{ label: lstrings.string_cancel, onPress: handleCancelPress }}
/>
</SceneContainer>
Expand Down

0 comments on commit b200979

Please sign in to comment.