Skip to content

Commit

Permalink
Merge branch 'develop' into feat/disconnected-state
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed Dec 29, 2022
2 parents 238c949 + b67709c commit 1eb541e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Improvements

- [#52](https://github.com/alleslabs/celatone-frontend/pull/52) Create a component for disconnected State and apply to contract, code, past tx
- [#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

0 comments on commit 1eb541e

Please sign in to comment.