feat: assign default default messages on sales transactions

This commit is contained in:
Ahmed Bouhuolia
2023-12-16 19:26:41 +02:00
parent ad53ddb9dd
commit 6953f7c4a3
12 changed files with 189 additions and 137 deletions

View File

@@ -4,6 +4,8 @@ import classNames from 'classnames';
import { CLASSES } from '@/constants/classes';
import { useSettings } from '@/hooks/query';
import PreferencesPageLoader from '../PreferencesPageLoader';
import styled from 'styled-components';
import { Card } from '@/components';
const PreferencesEstimatesFormContext = React.createContext();
@@ -13,9 +15,8 @@ function PreferencesEstimatesBoot({ ...props }) {
// Provider state.
const provider = {
organization: {},
isSettingsLoading,
};
// Detarmines whether if any query is loading.
const isLoading = isSettingsLoading;
@@ -26,11 +27,16 @@ function PreferencesEstimatesBoot({ ...props }) {
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT_ACCOUNTANT,
)}
>
{isLoading ? (
<PreferencesPageLoader />
) : (
<PreferencesEstimatesFormContext.Provider value={provider} {...props} />
)}
<PreferencesEstimatesCard>
{isLoading ? (
<PreferencesPageLoader />
) : (
<PreferencesEstimatesFormContext.Provider
value={provider}
{...props}
/>
)}
</PreferencesEstimatesCard>
</div>
);
}
@@ -38,4 +44,12 @@ function PreferencesEstimatesBoot({ ...props }) {
const usePreferencesEstimatesFormContext = () =>
React.useContext(PreferencesEstimatesFormContext);
const PreferencesEstimatesCard = styled(Card)`
padding: 25px;
.bp4-form-group {
max-width: 600px;
}
`;
export { PreferencesEstimatesBoot, usePreferencesEstimatesFormContext };