feat(ui): move to React 18 and base for using shadcn/ui (#4174)
Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
This commit is contained in:
1 parent
72b63dcd6a
commit
70f2c797f4
153 files changed
+2973
-2043
No files matched your search
@@ -17,7 +17,7 @@ const DialogContext = createContext(null);
|
||||
|
||||
export const useDialog = () => useContext(DialogContext);
|
||||
|
||||
const DialogProvider = ({ children, service }) => {
|
||||
const DialogProvider = ({ children, service = null }) => {
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [dialogs, setDialogs] = useState([]);
|
||||
const [lastDialogId, setLastDialogId] = useState(null);
|
||||
@@ -300,10 +300,6 @@ export const withDialog = Component => {
|
||||
};
|
||||
};
|
||||
|
||||
DialogProvider.defaultProps = {
|
||||
service: null,
|
||||
};
|
||||
|
||||
DialogProvider.propTypes = {
|
||||
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.func])
|
||||
.isRequired,
|
||||
|
||||
@@ -2,27 +2,17 @@ import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
export const ModalComponent = ({
|
||||
content,
|
||||
contentProps,
|
||||
shouldCloseOnEsc,
|
||||
isOpen,
|
||||
closeButton,
|
||||
title,
|
||||
customClassName,
|
||||
content = null,
|
||||
contentProps = null,
|
||||
shouldCloseOnEsc = true,
|
||||
isOpen = true,
|
||||
closeButton = true,
|
||||
title = null,
|
||||
customClassName = '',
|
||||
}) => {
|
||||
return <></>;
|
||||
};
|
||||
|
||||
ModalComponent.defaultProps = {
|
||||
content: null,
|
||||
contentProps: null,
|
||||
shouldCloseOnEsc: true,
|
||||
isOpen: true,
|
||||
closeButton: true,
|
||||
title: null,
|
||||
customClassName: '',
|
||||
};
|
||||
|
||||
ModalComponent.propTypes = {
|
||||
content: PropTypes.node,
|
||||
contentProps: PropTypes.object,
|
||||
|
||||
@@ -21,7 +21,7 @@ export const useModal = () => useContext(ModalContext);
|
||||
* @property {string} [customClassName=null] The custom class to style the modal.
|
||||
*/
|
||||
|
||||
const ModalProvider = ({ children, modal: Modal, service }) => {
|
||||
const ModalProvider = ({ children, modal: Modal, service = null }) => {
|
||||
const DEFAULT_OPTIONS = {
|
||||
content: null,
|
||||
contentProps: null,
|
||||
@@ -125,10 +125,6 @@ export const withModal = Component => {
|
||||
};
|
||||
};
|
||||
|
||||
ModalProvider.defaultProps = {
|
||||
service: null,
|
||||
};
|
||||
|
||||
ModalProvider.propTypes = {
|
||||
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
||||
modal: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.func])
|
||||
|
||||
@@ -8,7 +8,7 @@ const SnackbarContext = createContext(null);
|
||||
|
||||
export const useSnackbar = () => useContext(SnackbarContext);
|
||||
|
||||
const SnackbarProvider = ({ children, service }) => {
|
||||
const SnackbarProvider = ({ children, service = null }) => {
|
||||
const DEFAULT_OPTIONS = {
|
||||
title: '',
|
||||
message: '',
|
||||
@@ -104,10 +104,6 @@ const SnackbarProvider = ({ children, service }) => {
|
||||
);
|
||||
};
|
||||
|
||||
SnackbarProvider.defaultProps = {
|
||||
service: null,
|
||||
};
|
||||
|
||||
SnackbarProvider.propTypes = {
|
||||
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.func])
|
||||
.isRequired,
|
||||
|
||||
Reference in new issue
Block a user