mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
refactor: use the new button component on forms and dialogs (#16050)
This is a significant PR that will impact many parts of the UI, so I’d like to ask you, @jaaydenh, for a very thorough review of the Storybook stories on Chromatic. I know it’s a bit of a hassle with around 180 stories affected, but it’s all for a good cause 💪 Main changes: - Update the `Button` component to match the [new buttons design](https://www.figma.com/design/WfqIgsTFXN2BscBSSyXWF8/Coder-kit?node-id=3-1756&p=f&m=dev). - Update forms and dialogs to use the new `Button` component. Related to https://github.com/coder/coder/issues/14978
This commit is contained in:
@ -4,12 +4,14 @@ import TextField from "@mui/material/TextField";
|
||||
import { hasApiFieldErrors, isApiError } from "api/errors";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import { ErrorAlert } from "components/Alert/ErrorAlert";
|
||||
import { FormFooter } from "components/FormFooter/FormFooter";
|
||||
import { Button } from "components/Button/Button";
|
||||
import { FormFooter } from "components/Form/Form";
|
||||
import { FullPageForm } from "components/FullPageForm/FullPageForm";
|
||||
import { PasswordField } from "components/PasswordField/PasswordField";
|
||||
import { Spinner } from "components/Spinner/Spinner";
|
||||
import { Stack } from "components/Stack/Stack";
|
||||
import { type FormikContextType, useFormik } from "formik";
|
||||
import { type FC, useEffect } from "react";
|
||||
import type { FC } from "react";
|
||||
import {
|
||||
displayNameValidator,
|
||||
getFormHelpers,
|
||||
@ -202,11 +204,16 @@ export const CreateUserForm: FC<
|
||||
label={Language.passwordLabel}
|
||||
/>
|
||||
</Stack>
|
||||
<FormFooter
|
||||
submitLabel="Create user"
|
||||
onCancel={onCancel}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
|
||||
<FormFooter className="mt-8">
|
||||
<Button onClick={onCancel} variant="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" disabled={isLoading}>
|
||||
{isLoading && <Spinner />}
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
</form>
|
||||
</FullPageForm>
|
||||
);
|
||||
|
Reference in New Issue
Block a user