types APIs
- SimpleOptions
- RootState
- User
- ChainType
- FeedbackCategoryAPI
- FeedbackStatusAPI
- FeedbackUserProfileAPI
- NavItems
- SingleNavItem
- NonNullableChildrenDeep
- SingleArticle
- ColumnType
- DataType
- Hub
- PluginConfig
- RawEventMessage
- DualStakingInfo
- StakingInfo
- SyrupInfo
- CommonStakingInfo
- LairInfo
- StakingBasic
- DualStakingBasic
- SyrupBasic
- Questionnaire
- TaskStatuses
- LoginPayload
- SignupPayload
- MutationType
- ProteinSize
- Config
- Themes
- defaults
- CoordinateSpaceInitial
- Background
- Metric
- Metadata
- TManageValue
- Domain
- Organization
- OrganizationTag
- Scan
- ScanSchema
- Query
- SavedSearch
- Role
- ScanTask
- Vulnerability
- GenericObject
- Annotation
- AnnotationList
- VideoAnnotation
- IconName
- IllustrationName
- INotification
- BottomTabScreens
- KYCScreens
- CCVPScreens
- LoginScreens
- PreAuthScreens
- SignUpScreens
- TFAScreens
- PNVScreens
- ProfileScreens
- SecurityScreens
- SMTYFScreens
- WalletScreens
- WithdrawalScreens
- StackNavigationProps
- Coin
- Country
- TransactionStatus
- SetApiActionPayloadInterface
- LoadingStateInterface
- MessageStateInterface
- UiOptionType
- ApiDiffInterface
- ApiStateInterface
- Account
- NFT
- NFTDetails
- AlertType
- DefaultTemplateOptions
- ProviderProps
- AlertTimer
- AlertInstance
- AlertOptions
- TemplateAlertOptions
- AlertContainerFactory
- ChainBase
- ChainNetwork
- WalletId
- ProposalType
- ChainEventNotification
- WebsocketMessageNames
- WebsocketNamespaces
- NotificationCategories
- InviteCodeAttributes
- IPostNotificationData
- ChainCategoryType
- Screens
- NavigationProperty
- IP
- Maybe
- Tuple
- ChainProperties
- ApiPromise
- ApiAction
- BlueprintOptions
- ContractQuery
- ContractOptions
- ContractTx
- KeyringPair
- ContractDryRunParams
- InstantiateData
- SubmittableExtrinsic
- DbState
- OnInstantiateSuccess$Code
- OnInstantiateSuccess$Hash
- InstantiateState
- ApiState
- OrFalsy
- Bytes
- AbiParam
- Registry
- Weight
- SubmittableResult
- Hash
- CodeBundleDocument
- MyCodeBundles
- ContractDocument
- MyContracts
- Database
- DbStatistics
- UserDocument
- QueuedTxOptions
- TransactionsState
- DropdownOption
- DropdownProps
- ValidFormField
- SetState
- BN
- CallResult
- ContractPromise
- RegistryError
- Abi
- TypeDef
- Validation
- FileState
- UseWeight
- ArgComponentProps
- TypeDefInfo
- UseMetadata
- AbiMessage
- AbiConstructor
- InstantiateProps
- CodeSubmittableResult
- BlueprintSubmittableResult
- BlueprintPromise
- Step2FormData
- TxOptions
- TransactionsQueue
- Keyring
- DbQuery
- UseBalance
- CodeBundle
- ValidateFn
- MetadataState
- UseStepper
- UseToggle
- Party
- Restaurant
- BoardMember
- Id
- Label
- Priority
- Avatar
- PriorityValue
- AuthSetup
- IColumn
- Board
- ITask
- TaskComment
- NewTaskComment
- WithTheme
- UserDetail
- TasksByColumn
- NewTask
- ValueOf
- APIResponse
- Nullable
- Currency
- Route
- Author
- Post
- Category
- Watch
- ComputeCallback
Other Related APIs
types#SignupPayload TypeScript Examples
The following examples show how to use
types#SignupPayload.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: register.tsx From RareCamp with Apache License 2.0 | 4 votes |
export default function App() {
const router = useRouter()
const mutation = useMutation(
({ name, password, username }: SignupPayload) =>
Auth.signUp({
username,
password,
attributes: { email: username, name },
}),
{
onSuccess: async (_, { username, password }) => {
notification.success({
message: 'Successfully signed up user!',
description:
'Account created successfully, Redirecting you in a few!',
placement: 'topRight',
duration: 1.5,
})
await Auth.signIn(username, password)
await router.push('/')
},
onError: async (err: Error) =>
notification.error({
message: 'Error',
description: err.message,
placement: 'topRight',
duration: 1.5,
}),
},
)
return (
<AuthLayout>
<div>
<Title level={3}>Signup for an account</Title>
<p>
or{' '}
<Link onClick={() => router.push('/auth/login')}>
log in to your account
</Link>
</p>
</div>
<Form
layout="vertical"
name="register_form"
onFinish={mutation.mutate}
>
<Form.Item
label={<span style={{ fontWeight: 500 }}>Email</span>}
name="username"
required={false}
rules={[
{
required: true,
message: 'Please input your email',
type: 'email',
},
]}
>
<Input placeholder="[email protected]" />
</Form.Item>
<Form.Item
label={<span style={{ fontWeight: 500 }}>Name</span>}
name="name"
required={false}
rules={[
{ required: true, message: 'Please input your name' },
]}
>
<Input placeholder="Jhon Rick " />
</Form.Item>
<Form.Item
style={{ marginBottom: '10px' }}
label={<span style={{ fontWeight: 500 }}>Password</span>}
name="password"
required={false}
rules={[
{
required: true,
message: 'Please input your password',
},
]}
>
<Input.Password placeholder="Must be at least 8 characters" />
</Form.Item>
<>
<Form.Item>
<Button
type="primary"
disabled={mutation.isLoading}
loading={mutation.isLoading}
htmlType="submit"
block
className="login-form-button"
>
Sign up
</Button>
</Form.Item>
</>
</Form>
</AuthLayout>
)
}