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:
AlirezaandIbrahimCSAE authored and GitHub committed 2024-05-27 14:30:25 -04:00
1 parent 72b63dcd6a
commit 70f2c797f4
153 files changed
+2973 -2043

No files matched your search

+5 -11
View File
@@ -15,10 +15,10 @@ const Dialog = ({
actions,
onShow,
onSubmit,
header: HeaderComponent,
body: BodyComponent,
footer: FooterComponent,
value: defaultValue,
header: HeaderComponent = Header,
body: BodyComponent = Body,
footer: FooterComponent = Footer,
value: defaultValue = {},
}) => {
const [value, setValue] = useState(defaultValue);
@@ -78,13 +78,7 @@ Dialog.propTypes = {
type: PropTypes.oneOf(['primary', 'secondary', 'cancel']).isRequired,
})
).isRequired,
};
Dialog.defaultProps = {
header: Header,
footer: Footer,
body: Body,
value: {},
onShow: PropTypes.func,
};
export default Dialog;
+1 -6
View File
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import Button, { ButtonEnums } from '../Button';
const Footer = ({ actions, className, onSubmit, value }) => {
const Footer = ({ actions = [], className, onSubmit = () => {}, value }) => {
const flex = 'flex items-center justify-end';
const padding = 'pt-[20px]';
@@ -47,9 +47,4 @@ Footer.propTypes = {
).isRequired,
};
Footer.defaultProps = {
onSubmit: noop,
actions: [],
};
export default Footer;
+1 -5
View File
@@ -20,7 +20,7 @@ CloseButton.propTypes = {
onClick: PropTypes.func,
};
const Header = ({ title, noCloseButton, onClose }) => {
const Header = ({ title, noCloseButton = false, onClose }) => {
const theme = 'bg-primary-dark';
const flex = 'flex items-center justify-between';
const padding = 'pb-[20px]';
@@ -46,8 +46,4 @@ Header.propTypes = {
onClose: PropTypes.func,
};
Header.defaultProps = {
noCloseButton: false,
};
export default Header;