diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index c92efd188..d28f74b68 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -17,6 +17,7 @@ "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dialog": "^1.0.4", "@radix-ui/react-dropdown-menu": "^2.0.5", + "@radix-ui/react-form": "^0.0.3", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-menubar": "^1.0.3", @@ -1777,6 +1778,34 @@ } } }, + "node_modules/@radix-ui/react-form": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.0.3.tgz", + "integrity": "sha512-kgE+Z/haV6fxE5WqIXj05KkaXa3OkZASoTDy25yX2EIp/x0c54rOH/vFr5nOZTg7n7T1z8bSyXmiVIFP9bbhPQ==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-id": "1.0.1", + "@radix-ui/react-label": "2.0.2", + "@radix-ui/react-primitive": "1.0.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-icons": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-icons/-/react-icons-1.3.0.tgz", diff --git a/src/frontend/package.json b/src/frontend/package.json index dd0cadeeb..b4afc7999 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -12,6 +12,7 @@ "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dialog": "^1.0.4", "@radix-ui/react-dropdown-menu": "^2.0.5", + "@radix-ui/react-form": "^0.0.3", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-menubar": "^1.0.3", diff --git a/src/frontend/src/components/PaginatorComponent/index.tsx b/src/frontend/src/components/PaginatorComponent/index.tsx index 96f6dd067..29921c60a 100644 --- a/src/frontend/src/components/PaginatorComponent/index.tsx +++ b/src/frontend/src/components/PaginatorComponent/index.tsx @@ -20,7 +20,7 @@ export default function PaginatorComponent({ pageIndex = 1, rowsCount = [10, 20, 30], totalRowsCount = 0, - paginate, + paginate }: PaginatorComponentType) { const [size, setPageSize] = useState(pageSize); const [index, setPageIndex] = useState(pageIndex); diff --git a/src/frontend/src/modals/ConfirmationModal/index.tsx b/src/frontend/src/modals/ConfirmationModal/index.tsx new file mode 100644 index 000000000..1e615d799 --- /dev/null +++ b/src/frontend/src/modals/ConfirmationModal/index.tsx @@ -0,0 +1,66 @@ +import { useState } from "react"; +import { Button } from "../../components/ui/button"; +import { ConfirmationModalType } from "../../types/components"; +import { nodeIconsLucide } from "../../utils/styleUtils"; +import BaseModal from "../baseModal"; + +export default function ConfirmationModal({ + title, + titleHeader, + modalContent, + modalContentTitle, + cancelText, + confirmationText, + children, + icon, + data, + index, + onConfirm, +}: ConfirmationModalType) { + const Icon: any = nodeIconsLucide[icon]; + + const [open, setOpen] = useState(false); + return ( + + {children} + + {title} + + + {modalContentTitle != "" && ( + <> + {modalContentTitle} +

+ + )} + {modalContent} +
+ + + + + + +
+ ); +} diff --git a/src/frontend/src/modals/UserManagementModal/index.tsx b/src/frontend/src/modals/UserManagementModal/index.tsx new file mode 100644 index 000000000..1ab661223 --- /dev/null +++ b/src/frontend/src/modals/UserManagementModal/index.tsx @@ -0,0 +1,94 @@ +import { useState } from "react"; +import { Button } from "../../components/ui/button"; +import { ConfirmationModalType, UserManagementType } from "../../types/components"; +import { nodeIconsLucide } from "../../utils/styleUtils"; +import BaseModal from "../baseModal"; +import * as Form from '@radix-ui/react-form'; + +export default function UserManagementModal({ + title, + titleHeader, + cancelText, + confirmationText, + children, + icon, + data, + index, + onConfirm, +}: UserManagementType) { + const Icon: any = nodeIconsLucide[icon]; + + const [open, setOpen] = useState(false); + return ( + + {children} + + {title} + + + + + + +
+ Email + + Please enter your email + + + Please provide a valid email + +
+ + + +
+ +
+ Question + + Please enter a question + +
+ +