Skip to content

Commit

Permalink
chore(web): fix padding settings for page (#823)
Browse files Browse the repository at this point in the history
Co-authored-by: nina992 <nouralali992@gmail.com>
  • Loading branch information
nina992 and nina992 committed Nov 17, 2023
1 parent 972fda8 commit f9a7d49
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 15 deletions.
19 changes: 14 additions & 5 deletions web/src/beta/lib/core/StoryPanel/ActionPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,22 @@ type Props = {
schemaItemId?: string,
fieldId?: string,
itemId?: string,
vt?: string,
vt?: any,
v?: any,
) => Promise<void>;
onPropertyItemAdd?: () => Promise<void>;
onPropertyItemMove?: () => Promise<void>;
onPropertyItemDelete?: () => Promise<void>;
onBlockMove?: (id: string, targetId: number, blockId: string) => void;
onPropertyItemAdd?: (propertyId?: string, schemaGroupId?: string) => Promise<void>;
onPropertyItemMove?: (
propertyId?: string,
schemaGroupId?: string,
itemId?: string,
index?: number,
) => Promise<void>;
onPropertyItemDelete?: (
propertyId?: string,
schemaGroupId?: string,
itemId?: string,
) => Promise<void>;
};

const ActionPanel: React.FC<Props> = ({
Expand Down Expand Up @@ -89,7 +99,6 @@ const ActionPanel: React.FC<Props> = ({
}
return menuItems;
}, [settingsTitle, t, setShowPadding, onRemove, handleRemove]);

return (
<Wrapper isSelected={isSelected} position={position} onClick={stopClickPropagation}>
{dndEnabled && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@ type Props = {
schemaItemId?: string,
fieldId?: string,
itemId?: string,
vt?: string,
vt?: any,
v?: any,
) => Promise<void>;
onPropertyItemAdd?: () => Promise<void>;
onPropertyItemMove?: () => Promise<void>;
onPropertyItemDelete?: () => Promise<void>;
onBlockMove?: (id: string, targetId: number, blockId: string) => void;
onPropertyItemAdd?: (propertyId?: string, schemaGroupId?: string) => Promise<void>;
onPropertyItemMove?: (
propertyId?: string,
schemaGroupId?: string,
itemId?: string,
index?: number,
) => Promise<void>;
onPropertyItemDelete?: (
propertyId?: string,
schemaGroupId?: string,
itemId?: string,
) => Promise<void>;
};

const BlockActionPanel: React.FC<Props> = ({
Expand Down
6 changes: 5 additions & 1 deletion web/src/beta/lib/core/StoryPanel/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ const StoryPanel: React.FC<Props> = ({
showSettings={showPageSettings}
isEditable={isEditable}
onClick={() => onPageSelect?.(page?.id)}
onSettingsToggle={onPageSettingsToggle}>
onSettingsToggle={onPageSettingsToggle}
onPropertyUpdate={onPropertyUpdate}
onPropertyItemAdd={onPropertyItemAdd}
onPropertyItemDelete={onPropertyItemDelete}
onPropertyItemMove={onPropertyItemMove}>
<Wrapper
id={page?.id}
ref={containerRef}
Expand Down
20 changes: 15 additions & 5 deletions web/src/beta/lib/core/StoryPanel/SelectableArea/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Dispatch, ReactNode, SetStateAction } from "react";

import { ValueType, ValueTypes } from "@reearth/beta/utils/value";
import { styled } from "@reearth/services/theme";

import ActionPanel, { type ActionPosition } from "../Block/builtin/common/ActionPanel";
Expand Down Expand Up @@ -29,12 +30,21 @@ type Props = {
schemaItemId?: string,
fieldId?: string,
itemId?: string,
vt?: string,
v?: any,
vt?: ValueType,
v?: ValueTypes[ValueType],
) => Promise<void>;
onPropertyItemAdd?: (propertyId?: string, schemaGroupId?: string) => Promise<void>;
onPropertyItemMove?: (
propertyId?: string,
schemaGroupId?: string,
itemId?: string,
index?: number,
) => Promise<void>;
onPropertyItemDelete?: (
propertyId?: string,
schemaGroupId?: string,
itemId?: string,
) => Promise<void>;
onPropertyItemAdd?: () => Promise<void>;
onPropertyItemMove?: () => Promise<void>;
onPropertyItemDelete?: () => Promise<void>;
};

const SelectableArea: React.FC<Props> = ({
Expand Down

0 comments on commit f9a7d49

Please sign in to comment.