ui(admin): update button components, fix Editor for eggs
This commit is contained in:
parent
4e56f6dbea
commit
089860b721
35 changed files with 363 additions and 623 deletions
|
@ -4,7 +4,7 @@ import { useState } from 'react';
|
|||
import tw from 'twin.macro';
|
||||
|
||||
import deleteMount from '@/api/admin/mounts/deleteMount';
|
||||
import Button from '@/components/elements/Button';
|
||||
import { Button } from '@/components/elements/button';
|
||||
import ConfirmationModal from '@/components/elements/ConfirmationModal';
|
||||
import type { ApplicationStore } from '@/state';
|
||||
|
||||
|
@ -52,7 +52,7 @@ export default ({ mountId, onDeleted }: Props) => {
|
|||
Are you sure you want to delete this mount? Deleting a mount will not delete files on any nodes.
|
||||
</ConfirmationModal>
|
||||
|
||||
<Button type={'button'} size={'xsmall'} color={'red'} onClick={() => setVisible(true)}>
|
||||
<Button.Danger type="button" onClick={() => setVisible(true)}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
|
@ -67,7 +67,7 @@ export default ({ mountId, onDeleted }: Props) => {
|
|||
d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
|
||||
/>
|
||||
</svg>
|
||||
</Button>
|
||||
</Button.Danger>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import type { FormikHelpers } from 'formik';
|
||||
import { Field as FormikField, Form, Formik } from 'formik';
|
||||
import type { ReactNode } from 'react';
|
||||
import tw from 'twin.macro';
|
||||
import { boolean, object, string } from 'yup';
|
||||
|
||||
import AdminBox from '@/components/admin/AdminBox';
|
||||
import Button from '@/components/elements/Button';
|
||||
import { Button } from '@/components/elements/button';
|
||||
import Field from '@/components/elements/Field';
|
||||
import Label from '@/components/elements/Label';
|
||||
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
||||
|
@ -25,7 +26,7 @@ interface Props {
|
|||
|
||||
onSubmit: (values: Values, helpers: FormikHelpers<Values>) => void;
|
||||
|
||||
children?: React.ReactNode;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
function MountForm({ action, title, initialValues, children, onSubmit }: Props) {
|
||||
|
@ -118,7 +119,7 @@ function MountForm({ action, title, initialValues, children, onSubmit }: Props)
|
|||
{children}
|
||||
|
||||
<div css={tw`flex ml-auto`}>
|
||||
<Button type={'submit'} disabled={isSubmitting || !isValid}>
|
||||
<Button type="submit" disabled={isSubmitting || !isValid}>
|
||||
{action}
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,8 @@ import AdminTable, {
|
|||
ContentWrapper,
|
||||
useTableHooks,
|
||||
} from '@/components/admin/AdminTable';
|
||||
import Button from '@/components/elements/Button';
|
||||
import { Button } from '@/components/elements/button';
|
||||
import { Size } from '@/components/elements/button/types';
|
||||
import CopyOnClick from '@/components/elements/CopyOnClick';
|
||||
import FlashMessageRender from '@/components/FlashMessageRender';
|
||||
import useFlash from '@/plugins/useFlash';
|
||||
|
@ -94,7 +95,7 @@ const MountsContainer = () => {
|
|||
|
||||
<div css={tw`flex ml-auto pl-4`}>
|
||||
<NavLink to={`/admin/mounts/new`}>
|
||||
<Button type={'button'} size={'large'} css={tw`h-10 px-4 py-0 whitespace-nowrap`}>
|
||||
<Button type={'button'} size={Size.Large} css={tw`h-10 px-4 py-0 whitespace-nowrap`}>
|
||||
New Mount
|
||||
</Button>
|
||||
</NavLink>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue