fix(modal and dialogues): fixes as per specifications (#3438)
Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
ffaffbdfa3
commit
da5c32bce3
27 files changed
+180
-170
No files matched your search
@@ -8,11 +8,13 @@ const Body = ({ text, className }) => {
|
||||
const theme = 'bg-primary-dark';
|
||||
return (
|
||||
<div className={classNames('relative flex-auto', theme, className)}>
|
||||
<div className="p-6">
|
||||
<Typography variant="body" className="my-4 leading-relaxed">
|
||||
{text}
|
||||
</Typography>
|
||||
</div>
|
||||
<Typography
|
||||
variant="inherit"
|
||||
color="initial"
|
||||
className="text-[14px] !leading-[1.2]"
|
||||
>
|
||||
{text}
|
||||
</Typography>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -22,12 +22,13 @@ const Dialog = ({
|
||||
}) => {
|
||||
const [value, setValue] = useState(defaultValue);
|
||||
|
||||
const theme = 'bg-secondary-light';
|
||||
const theme = 'bg-primary-dark';
|
||||
const flex = 'flex flex-col';
|
||||
const border = 'border-0 rounded-lg drop-shadow-lg';
|
||||
const border = 'border-0 rounded';
|
||||
const outline = 'outline-none focus:outline-none';
|
||||
const position = 'relative';
|
||||
const width = 'w-full';
|
||||
const padding = 'px-[20px] pb-[20px] pt-[13px]';
|
||||
|
||||
useEffect(() => {
|
||||
if (onShow) {
|
||||
@@ -36,7 +37,17 @@ const Dialog = ({
|
||||
}, [onShow]);
|
||||
|
||||
return (
|
||||
<div className={classNames(theme, flex, border, outline, position, width)}>
|
||||
<div
|
||||
className={classNames(
|
||||
theme,
|
||||
flex,
|
||||
border,
|
||||
outline,
|
||||
position,
|
||||
width,
|
||||
padding
|
||||
)}
|
||||
>
|
||||
<HeaderComponent
|
||||
title={title}
|
||||
noCloseButton={noCloseButton}
|
||||
|
||||
@@ -6,12 +6,10 @@ import { Button } from '..';
|
||||
|
||||
const Footer = ({ actions, className, onSubmit, value }) => {
|
||||
const flex = 'flex items-center justify-end';
|
||||
const border = 'border-t-2 border-solid border-black rounded-b';
|
||||
const spacing = 'p-6';
|
||||
const theme = 'bg-primary-dark';
|
||||
const padding = 'pt-[20px]';
|
||||
|
||||
return (
|
||||
<div className={classNames(flex, border, spacing, theme, className)}>
|
||||
<div className={classNames(flex, padding, className)}>
|
||||
{actions.map((action, index) => {
|
||||
const isFirst = index === 0;
|
||||
const isPrimary = action.type === 'primary';
|
||||
|
||||
@@ -10,7 +10,7 @@ const CloseButton = ({ onClick }) => {
|
||||
data-cy="close-button"
|
||||
onClick={onClick}
|
||||
name="close"
|
||||
className="cursor-pointer text-primary-active w-6 h-6"
|
||||
className="cursor-pointer text-primary-active"
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -20,14 +20,13 @@ CloseButton.propTypes = {
|
||||
};
|
||||
|
||||
const Header = ({ title, noCloseButton, onClose }) => {
|
||||
const theme = 'bg-secondary-main';
|
||||
const theme = 'bg-primary-dark';
|
||||
const flex = 'flex items-center justify-between';
|
||||
const border = 'border-b-2 border-solid border-black rounded-t';
|
||||
const spacing = 'p-4';
|
||||
const padding = 'pb-[20px]';
|
||||
|
||||
return (
|
||||
<div className={classNames(theme, flex, border, spacing)}>
|
||||
<Typography variant="h6" color="primaryActive">
|
||||
<div className={classNames(theme, flex, padding)}>
|
||||
<Typography variant="h6" color="primaryLight" className="!leading-[1.2]">
|
||||
{title}
|
||||
</Typography>
|
||||
{!noCloseButton && <CloseButton onClick={onClose} />}
|
||||
|
||||
Reference in new issue
Block a user