mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Lint, export Language
This commit is contained in:
@@ -12,32 +12,32 @@ const Template: Story<CreateUserFormProps> = (args: CreateUserFormProps) => <Cre
|
||||
|
||||
export const Ready = Template.bind({})
|
||||
Ready.args = {
|
||||
onCancel: action('cancel'),
|
||||
onSubmit: action('submit'),
|
||||
onCancel: action("cancel"),
|
||||
onSubmit: action("submit"),
|
||||
isLoading: false,
|
||||
}
|
||||
|
||||
export const UnknownError = Template.bind({})
|
||||
UnknownError.args = {
|
||||
onCancel: action('cancel'),
|
||||
onSubmit: action('submit'),
|
||||
onCancel: action("cancel"),
|
||||
onSubmit: action("submit"),
|
||||
isLoading: false,
|
||||
error: "Something went wrong"
|
||||
error: "Something went wrong",
|
||||
}
|
||||
|
||||
export const FormError = Template.bind({})
|
||||
FormError.args = {
|
||||
onCancel: action('cancel'),
|
||||
onSubmit: action('submit'),
|
||||
onCancel: action("cancel"),
|
||||
onSubmit: action("submit"),
|
||||
isLoading: false,
|
||||
formErrors: {
|
||||
email: "Bad email address"
|
||||
}
|
||||
email: "Bad email address",
|
||||
},
|
||||
}
|
||||
|
||||
export const Loading = Template.bind({})
|
||||
Loading.args = {
|
||||
onCancel: action('cancel'),
|
||||
onSubmit: action('submit'),
|
||||
onCancel: action("cancel"),
|
||||
onSubmit: action("submit"),
|
||||
isLoading: true,
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { getFormHelpers, onChangeTrimmed } from "../../util/formUtils"
|
||||
import { FormFooter } from "../FormFooter/FormFooter"
|
||||
import { FullPageForm } from "../FullPageForm/FullPageForm"
|
||||
|
||||
const Language = {
|
||||
export const Language = {
|
||||
emailLabel: "Email",
|
||||
passwordLabel: "Password",
|
||||
usernameLabel: "Username",
|
||||
@@ -45,7 +45,6 @@ export const CreateUserForm: React.FC<CreateUserFormProps> = ({ onSubmit, onCanc
|
||||
onSubmit,
|
||||
})
|
||||
const getFieldHelpers = getFormHelpers<CreateUserRequest>(form, formErrors)
|
||||
console.log(getFieldHelpers("email"))
|
||||
|
||||
return (
|
||||
<FullPageForm title="Create user" onCancel={onCancel}>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { makeStyles } from "@material-ui/core/styles"
|
||||
import React from "react"
|
||||
import { LoadingButton } from "../LoadingButton/LoadingButton"
|
||||
|
||||
const Language = {
|
||||
export const Language = {
|
||||
cancelLabel: "Cancel",
|
||||
defaultSubmitLabel: "Submit",
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CreateUserRequest } from "../../../api/typesGenerated"
|
||||
import { CreateUserForm } from "../../../components/CreateUserForm/CreateUserForm"
|
||||
import { XServiceContext } from "../../../xServices/StateContext"
|
||||
|
||||
const Language = {
|
||||
export const Language = {
|
||||
unknownError: "Oops, an unknown error occurred.",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user