Skip to content

Commit

Permalink
🐛 fix(sections): fix sections persitent scrolls
Browse files Browse the repository at this point in the history
  • Loading branch information
thrownullexception committed Dec 23, 2023
1 parent dd79434 commit 79cd084
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ContentLayout.Left = function SectionLeft({ children }: IProps) {
};

ContentLayout.Right = function SectionRight({ children }: IProps) {
return <div style={{ overflowX: "scroll" }}>{children}</div>;
return <div style={{ overflowX: "hidden" }}>{children}</div>;
};

ContentLayout.Center = function SectionCenter({ children }: IProps) {
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/hooks/data/data.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
ENTITY_REFERENCE_PATH,
SINGLE_DATA_MUTATION_ENDPOINTS_TO_CLEAR,
} from "./constants";
import { useEntityMetadataDetails } from "./portal";

export const useEntityDataDetails = ({
entity,
Expand All @@ -32,6 +33,8 @@ export const useEntityDataDetails = ({
}) => {
const entityCrudConfig = useEntityCrudConfig(entity);

useEntityMetadataDetails({ entity, entityId, column });

return useApi<Record<string, string>>(
ENTITY_DETAILS_PATH({ entity, entityId, column }),
{
Expand Down Expand Up @@ -172,10 +175,12 @@ export function useEntityDataUpdationMutation(
successMessage: entityCrudConfig.MUTATION_LANG.EDIT,
});

const metadata = useEntityMetadataDetails({ entity, entityId });

return useMutation(
async (data: Record<string, string>) =>
await makeActionRequest("PATCH", `/api/data/${entity}/${entityId}`, {
data,
data: { ...data, ...metadata },
}),
apiMutateOptions
);
Expand Down
1 change: 1 addition & 0 deletions src/frontend/hooks/data/portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {
DATA_MUTATION_QUERY_ENDPOINTS,
SINGLE_DATA_MUTATION_QUERY_ENDPOINTS,
useEntityMetadataDetails,
} from "./main";
10 changes: 10 additions & 0 deletions src/frontend/hooks/data/portal/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ export const SINGLE_DATA_MUTATION_QUERY_ENDPOINTS = (params: {
noop(params);
return [];
};

export const useEntityMetadataDetails = (params: {
entity: string;
entityId: string;
column?: string;
}) => {
noop(params);

return {};
};

0 comments on commit 79cd084

Please sign in to comment.