Merge pull request #173 from bigcapitalhq/abouhuolia/big-37-item-drawer-floating

fix(webapp): style of quick item drawer
This commit is contained in:
Ahmed Bouhuolia
2023-06-23 15:55:58 +02:00
committed by GitHub
2 changed files with 21 additions and 14 deletions

View File

@@ -17,16 +17,6 @@ import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
import { useDrawerContext } from '@/components/Drawer/DrawerProvider';
import { DRAWERS } from '@/constants/drawers';
/**
* Drawer item form loading.
* @returns {JSX}
*/
function DrawerItemFormLoading({ children }) {
const { isFormLoading } = useItemFormContext();
return <DrawerLoading loading={isFormLoading}>{children}</DrawerLoading>;
}
/**
* Quick create/edit item drawer form.
*/
@@ -72,6 +62,16 @@ function QuickCreateItemDrawerForm({
);
}
/**
* Drawer item form loading.
* @returns {JSX}
*/
function DrawerItemFormLoading({ children }) {
const { isFormLoading } = useItemFormContext();
return <DrawerLoading loading={isFormLoading}>{children}</DrawerLoading>;
}
export default R.compose(
withDrawerActions,
withDashboardActions,
@@ -79,10 +79,15 @@ export default R.compose(
const ItemFormCard = styled(Card)`
margin: 15px;
padding: 25px;
margin-bottom: calc(15px + 65px);
.page-form__floating-actions {
margin-left: -36px;
margin-right: -36px;
.page-form {
padding: 0;
&__floating-actions {
margin-left: -41px;
margin-right: -41px;
}
}
`;

View File

@@ -90,7 +90,9 @@ export default function ItemFormFormik({
};
return (
<div class={classNames(CLASSES.PAGE_FORM_ITEM, className)}>
<div
class={classNames(CLASSES.PAGE_FORM, CLASSES.PAGE_FORM_ITEM, className)}
>
<Formik
enableReinitialize={true}
validationSchema={isNewMode ? CreateItemFormSchema : EditItemFormSchema}