File tree Expand file tree Collapse file tree 1 file changed +21
-40
lines changed
apps/dashboard/src/components/contract-components/contract-publish-form Expand file tree Collapse file tree 1 file changed +21
-40
lines changed Original file line number Diff line number Diff line change 55 Input ,
66 InputGroup ,
77 InputRightElement ,
8+ Select ,
89 Textarea ,
9- Tooltip ,
1010 useBreakpointValue ,
1111} from "@chakra-ui/react" ;
1212import type { AbiParameter } from "abitype" ;
@@ -15,8 +15,6 @@ import { camelToTitle } from "contract-ui/components/solidity-inputs/helpers";
1515import { getTemplateValuesForType } from "lib/deployment/template-values" ;
1616import { useFormContext } from "react-hook-form" ;
1717import {
18- Button ,
19- Card ,
2018 Checkbox ,
2119 FormErrorMessage ,
2220 FormHelperText ,
@@ -133,44 +131,27 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
133131 />
134132 </ Flex >
135133 { paramTemplateValues . length > 0 && (
136- < InputRightElement width = "10.5rem" >
137- < Tooltip
138- bg = "transparent"
139- boxShadow = "none"
140- shouldWrapChildren
141- label = {
142- < Card
143- as = { Flex }
144- flexDir = "column"
145- gap = { 2 }
146- bgColor = "backgroundHighlight"
147- >
148- < Text >
149- { paramTemplateValues [ 0 ] ?. helperText } Click to
150- apply.
151- </ Text >
152- </ Card >
153- }
134+ < InputRightElement width = "12rem" >
135+ < Select
136+ size = "xs"
137+ placeholder = "Select value"
138+ onChange = { ( e ) => {
139+ form . setValue (
140+ `constructorParams.${ param . name ? param . name : "*" } .defaultValue` ,
141+ e . target . value ,
142+ { shouldDirty : true } ,
143+ ) ;
144+ } }
154145 >
155- < Button
156- size = "xs"
157- padding = "3"
158- paddingY = "3.5"
159- onClick = { ( ) => {
160- form . setValue (
161- `constructorParams.${
162- param . name ? param . name : "*"
163- } .defaultValue`,
164- paramTemplateValues [ 0 ] ?. value ,
165- {
166- shouldDirty : true ,
167- } ,
168- ) ;
169- } }
170- >
171- { paramTemplateValues [ 0 ] ?. value }
172- </ Button >
173- </ Tooltip >
146+ { paramTemplateValues . map ( ( paramTemplate ) => (
147+ < option
148+ key = { paramTemplate . value }
149+ value = { paramTemplate ?. value }
150+ >
151+ { paramTemplate ?. value }
152+ </ option >
153+ ) ) }
154+ </ Select >
174155 </ InputRightElement >
175156 ) }
176157 </ InputGroup >
You can’t perform that action at this time.
0 commit comments