@@ -30,6 +30,7 @@ import CeremonySection from "@/app/routes/reshare-dkg/ceremony-section.tsx";
3030import RemoveValidatorsSection from "@/app/routes/reshare-dkg/remove-validators-section.tsx" ;
3131import { FaCircleInfo } from "react-icons/fa6" ;
3232import { Tooltip } from "@/components/ui/tooltip.tsx" ;
33+ import { shortenAddress } from "@/lib/utils/strings.ts" ;
3334
3435enum ReshareSteps {
3536 Signature = 1 ,
@@ -66,6 +67,7 @@ const schema = z.object({
6667
6768const ReshareDkg = ( ) => {
6869 const [ currentStep , setCurrentStep ] = useState ( ReshareSteps . Signature ) ;
70+ const [ isOwnerInputDisabled , setIsOwnerInputDisabled ] = useState ( true ) ;
6971 const context = useBulkActionContext ( ) ;
7072 const isReshare = context . dkgReshareState . newOperators . length > 0 ;
7173 const account = useAccount ( ) ;
@@ -171,7 +173,34 @@ const ReshareDkg = () => {
171173 </ Tooltip >
172174 </ FormLabel >
173175 < FormControl >
174- < Input { ...field } />
176+ < Input
177+ { ...field }
178+ disabled = { isOwnerInputDisabled || isLoading }
179+ value = {
180+ isOwnerInputDisabled
181+ ? shortenAddress ( field . value )
182+ : field . value
183+ }
184+ rightSlot = {
185+ < Button
186+ className = "border-none text-primary-500 hover:bg-transparent hover:text-primary-500"
187+ variant = {
188+ isOwnerInputDisabled ? "outline" : "secondary"
189+ }
190+ onClick = { ( ) => {
191+ if (
192+ form . formState . errors . ownerAddress ||
193+ isLoading
194+ ) {
195+ return ;
196+ }
197+ setIsOwnerInputDisabled ( ! isOwnerInputDisabled ) ;
198+ } }
199+ >
200+ { isOwnerInputDisabled ? "Add" : "Save" }
201+ </ Button >
202+ }
203+ />
175204 </ FormControl >
176205 < FormMessage />
177206 </ FormItem >
@@ -186,7 +215,10 @@ const ReshareDkg = () => {
186215 < FormItem >
187216 < FormLabel > Set Withdrawal Address</ FormLabel >
188217 < FormControl >
189- < Input { ...field } />
218+ < Input
219+ { ...field }
220+ disabled = { field . disabled || isLoading }
221+ />
190222 </ FormControl >
191223 < FormMessage />
192224 </ FormItem >
0 commit comments