diff --git a/resources/scripts/components/admin/users/UsersContainerV2.tsx b/resources/scripts/components/admin/users/UsersContainerV2.tsx index 4010d301f..537b26c44 100644 --- a/resources/scripts/components/admin/users/UsersContainerV2.tsx +++ b/resources/scripts/components/admin/users/UsersContainerV2.tsx @@ -3,7 +3,16 @@ import http from '@/api/http'; import { User } from '@/api/admin/user'; import { AdminTransformers } from '@/api/admin/transformers'; import { Dropdown } from '@/components/elements/dropdown'; -import { DotsVerticalIcon, LockClosedIcon, PaperAirplaneIcon, PencilIcon, TrashIcon } from '@heroicons/react/solid'; +import { + DotsVerticalIcon, + LockClosedIcon, + PaperAirplaneIcon, + PencilIcon, + PlusIcon, + TrashIcon, +} from '@heroicons/react/solid'; +import { Button } from '@/components/elements/button/index'; +import { Dialog } from '@/components/elements/dialog'; const UsersContainerV2 = () => { const [ users, setUsers ] = useState([]); @@ -11,6 +20,8 @@ const UsersContainerV2 = () => { document.title = 'Admin | Users'; }, []); + const [ visible, setVisible ] = useState(false); + useEffect(() => { http.get('/api/application/users') .then(({ data }) => { @@ -20,8 +31,21 @@ const UsersContainerV2 = () => { }, []); return ( -
- +
+
+ +
+ setVisible(false)}> + + This account will be permanently deleted. + + setVisible(false)}>Cancel + Delete + + +
diff --git a/resources/scripts/components/elements/button/Button.tsx b/resources/scripts/components/elements/button/Button.tsx new file mode 100644 index 000000000..f3238beac --- /dev/null +++ b/resources/scripts/components/elements/button/Button.tsx @@ -0,0 +1,36 @@ +import React, { forwardRef } from 'react'; +import classNames from 'classnames'; +import styles from './button.module.css'; + +export type ButtonProps = JSX.IntrinsicElements['button'] & { + square?: boolean; + small?: boolean; +} + +const Button = forwardRef( + ({ children, square, small, className, ...rest }, ref) => { + return ( + + ); + }, +); + +const TextButton = forwardRef(({ className, ...props }, ref) => ( + // @ts-expect-error +
@@ -59,13 +83,13 @@ const UsersContainerV2 = () => { - + - }>Edit - }>Reset Password - }>Suspend - - } danger>Delete Account + }>Edit + }>Reset Password + }>Suspend + + } onClick={() => setVisible(true)} danger>Delete Account