Skip to content

Commit 25ebace

Browse files
committed
change edit mode
1 parent ea3ee63 commit 25ebace

File tree

7 files changed

+7
-12
lines changed

7 files changed

+7
-12
lines changed

src/components/ActionsBuilder/Action/Action.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export const ActionRow: React.FC<ActionViewProps> = ({
178178
setIsOpen={setIsEditActionModalOpen}
179179
action={decodedAction}
180180
onAddAction={onEdit}
181+
isEditable={isEditable}
181182
/>
182183
)}
183184
</CardWrapperWithMargin>

src/components/ActionsBuilder/Option/Option.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export const OptionRow: React.FC<OptionRowProps> = ({
148148
addAction(action);
149149
setIsActionsModalOpen(false);
150150
}}
151+
isEditable={false}
151152
/>
152153
</OptionWrapper>
153154
);

src/components/ActionsBuilder/SupportedActions/SetPermissions/SetPermissionsEditor.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ interface FormValues {
4949
const Permissions: React.FC<ActionEditorProps> = ({
5050
decodedCall,
5151
onSubmit,
52+
isEdit,
5253
}) => {
5354
const parsedData = useMemo<ParsedDataInterface>(() => {
5455
if (!decodedCall) return null;
@@ -66,10 +67,6 @@ const Permissions: React.FC<ActionEditorProps> = ({
6667
};
6768
}, [decodedCall]);
6869

69-
const isEdit = useMemo(() => {
70-
return !!decodedCall.args?.to || !!decodedCall.args?.functionSignature;
71-
}, []); //eslint-disable-line
72-
7370
const { t } = useTranslation();
7471

7572
const [activeTab, setActiveTab] = useState(parsedData.tab);

src/components/ActionsBuilder/SupportedActions/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface ActionViewProps {
3333
export interface ActionEditorProps extends ActionViewProps {
3434
updateCall?: (updatedCall: DecodedCall) => void;
3535
onSubmit: (decodedCall: DecodedCall | DecodedCall[]) => void;
36+
isEdit?: boolean;
3637
}
3738

3839
type SupportedActionViews = {

src/components/ActionsModal/ActionsModal.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const ActionModal: React.FC<ActionModalProps> = ({
3333
isOpen,
3434
setIsOpen,
3535
onAddAction,
36+
isEditable,
3637
}) => {
3738
const { t } = useTranslation();
3839
const { guildId } = useTypedParams();
@@ -161,6 +162,7 @@ const ActionModal: React.FC<ActionModalProps> = ({
161162
decodedCall={data}
162163
updateCall={setData}
163164
onSubmit={handleEditorSubmit}
165+
isEdit={isEditable}
164166
/>
165167
</EditorWrapper>
166168
);
@@ -219,12 +221,6 @@ const ActionModal: React.FC<ActionModalProps> = ({
219221
return decodedAction;
220222
}
221223

222-
function saveSupportedAction(call?: DecodedCall) {
223-
if (!call) return;
224-
const decodedAction = buildAction(call);
225-
onAddAction(decodedAction);
226-
}
227-
228224
function handleEditorSubmit(calls?: DecodedCall[] | DecodedCall) {
229225
if (!calls) return;
230226
onAddAction(

src/components/ActionsModal/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export interface ActionModalProps {
55
setIsOpen: (isOpen: boolean) => void;
66
onAddAction: (action: DecodedAction | DecodedAction[]) => void;
77
action?: DecodedAction;
8+
isEditable?: boolean;
89
}

src/hooks/Guilds/ens/useENSPublicResolverContract.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export function useENSAvatarUri(ensName: string, chainId?: number) {
1313
const supportedChainId = isAvailableOnENS(chainId) ? chainId : MAINNET_ID;
1414
const { resolver } = useENSResolver(ensName, supportedChainId);
1515
const { nameHash, error } = convertToNameHash(ensName);
16-
debugger;
1716
const { data, ...rest } = useContractRead({
1817
enabled: !error,
1918
addressOrName: resolver?.address,
@@ -32,7 +31,6 @@ export function useENSContentHash(ensName: string, chainId?: number) {
3231
const supportedChainId = isAvailableOnENS(chainId) ? chainId : MAINNET_ID;
3332
const { resolver, ...rest } = useENSResolver(ensName, supportedChainId);
3433
const { nameHash, error } = convertToNameHash(ensName);
35-
debugger;
3634
const { data } = useContractRead({
3735
enabled: !error,
3836
addressOrName: resolver?.address,

0 commit comments

Comments
 (0)