Skip to content

Commit

Permalink
Merge pull request #56 from alleslabs/fix/offchain-param
Browse files Browse the repository at this point in the history
Fix/offchain param
  • Loading branch information
evilpeach committed Dec 29, 2022
2 parents d1673dd + fd9d966 commit b67709c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Features

- [#44](https://github.com/alleslabs/celatone-frontend/pull/44) Render query cmds shortcut in contract detail page
- [#38](https://github.com/alleslabs/celatone-frontend/pull/38) Show execute msg cmds when wallet is not connected
- [#49](https://github.com/alleslabs/celatone-frontend/pull/49) Add `develop` branch to `main.yml`
Expand All @@ -49,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#56](https://github.com/alleslabs/celatone-frontend/pull/56) Refactor offchain form component by not receiving nameField and descriptionField
- [#50](https://github.com/alleslabs/celatone-frontend/pull/50) Refactor offchain component to use react-form and remove redundant offchain components, and refactor edit contract details modal

### Bug fixes
Expand Down
9 changes: 2 additions & 7 deletions src/lib/components/OffChainForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ export interface OffchainDetail {
}

interface OffChainFormProps<T extends OffchainDetail> {
// TODO: find a way to remove nameField and descriptionField
nameField: FieldPath<T>;
descriptionField: FieldPath<T>;
state: OffchainDetail;
control: Control<T>;
setTagsValue: (options: string[]) => void;
Expand All @@ -35,8 +32,6 @@ interface OffChainFormProps<T extends OffchainDetail> {
}

export const OffChainForm = <T extends OffchainDetail>({
nameField,
descriptionField,
state,
control,
setTagsValue,
Expand All @@ -47,7 +42,7 @@ export const OffChainForm = <T extends OffchainDetail>({
return (
<VStack gap="16px" w="full">
<ControllerInput
name={nameField}
name={"name" as FieldPath<T>}
control={control}
label="Name"
helperText="Set name for your contract"
Expand All @@ -59,7 +54,7 @@ export const OffChainForm = <T extends OffchainDetail>({
labelBgColor={labelBgColor}
/>
<ControllerTextarea
name={descriptionField}
name={"description" as FieldPath<T>}
control={control}
label="Description"
helperText="Help understanding what this contract do and how it works"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/modal/contract/ContractDetailsTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ export const ContractDetailsTemplate = ({
otherAction={resetForm}
>
<OffChainForm<OffchainDetail>
nameField="name"
descriptionField="description"
state={offchainState}
control={control}
setTagsValue={setTagsValue}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/modal/contract/SaveNewContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ export function SaveNewContract({ list, buttonProps }: SaveNewContractProps) {
/>

<OffChainForm<SaveNewContractDetail>
nameField="name"
descriptionField="description"
state={offchainState}
control={control}
setTagsValue={setTagsValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ export const InstantiateOffChainForm = observer(
</Flex>
)}
<OffChainForm<OffchainDetail>
nameField="name"
descriptionField="description"
state={offchainState}
control={control}
setTagsValue={setTagsValue}
Expand Down

1 comment on commit b67709c

@vercel
Copy link

@vercel vercel bot commented on b67709c Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.