File tree Expand file tree Collapse file tree 3 files changed +21
-15
lines changed
components/modal/components/Profile
pages/batch-create-offers Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { Typography } from "../../../../ui/Typography";
6
6
import { ProfileFormFields } from "../ProfileFormFields" ;
7
7
8
8
interface Props {
9
- onBlurName ?: ( ) => void ;
10
9
logoSubtitle ?: string ;
11
10
coverSubtitle ?: string ;
12
11
disableHandle ?: boolean ;
@@ -18,7 +17,6 @@ interface Props {
18
17
}
19
18
20
19
export default function LensFormFields ( {
21
- onBlurName,
22
20
logoSubtitle,
23
21
coverSubtitle,
24
22
disableHandle,
@@ -42,7 +40,6 @@ export default function LensFormFields({
42
40
< div > { children } </ div >
43
41
</ Grid >
44
42
< ProfileFormFields
45
- onBlurName = { onBlurName }
46
43
logoSubtitle = { logoSubtitle }
47
44
coverSubtitle = { coverSubtitle }
48
45
handleComponent = {
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import { GridContainer } from "../../../ui/GridContainer";
12
12
import { ProfilePreview } from "./ProfilePreview" ;
13
13
14
14
interface Props {
15
- onBlurName ?: ( ) => void ;
16
15
logoSubtitle ?: string ;
17
16
coverSubtitle ?: string ;
18
17
handleComponent ?: ReactNode ;
@@ -23,7 +22,6 @@ interface Props {
23
22
}
24
23
25
24
export function ProfileFormFields ( {
26
- onBlurName,
27
25
logoSubtitle,
28
26
coverSubtitle,
29
27
handleComponent : HandleComponent ,
@@ -97,12 +95,7 @@ export function ProfileFormFields({
97
95
</ FormField >
98
96
</ GridContainer >
99
97
< FormField title = "Your brand / name" required >
100
- < Input
101
- name = "name"
102
- placeholder = "Name"
103
- onBlur = { onBlurName }
104
- disabled = { disableName }
105
- />
98
+ < Input name = "name" placeholder = "Name" disabled = { disableName } />
106
99
</ FormField >
107
100
{ HandleComponent }
108
101
< FormField title = "Description" required >
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ function BatchCreateOffers() {
120
120
setOffersList ( [ ] ) ;
121
121
setInvalidFile ( false ) ;
122
122
}
123
+ if ( e . target ) {
124
+ // reset value so the same file can be uploaded again (in case the file was modified)
125
+ e . target . value = "" ;
126
+ }
123
127
} ;
124
128
125
129
const sellerOffers = useOffers (
@@ -232,12 +236,24 @@ function BatchCreateOffers() {
232
236
if ( hasUserRejectedTx ) {
233
237
showModal ( "TRANSACTION_FAILED" ) ;
234
238
} else {
239
+ const defaultError = "Please retry this action" ;
240
+ const userFriendlyError = await extractUserFriendlyError ( error , {
241
+ txResponse : txResponse as providers . TransactionResponse ,
242
+ provider : signer ?. provider as Provider ,
243
+ defaultError
244
+ } ) ;
245
+ const isValidationError =
246
+ error &&
247
+ typeof error === "object" &&
248
+ "errors" in error &&
249
+ Array . isArray ( error . errors ) &&
250
+ Object . values ( error . errors ) . every ( ( err ) => typeof err === "string" ) ;
235
251
showModal ( "TRANSACTION_FAILED" , {
236
252
errorMessage : "Something went wrong" ,
237
- detailedErrorMessage : await extractUserFriendlyError ( error , {
238
- txResponse : txResponse as providers . TransactionResponse ,
239
- provider : signer ?. provider as Provider
240
- } )
253
+ detailedErrorMessage :
254
+ defaultError === userFriendlyError && isValidationError
255
+ ? ( error ?. errors as string [ ] ) ?. join ( "\n" ) || defaultError
256
+ : defaultError
241
257
} ) ;
242
258
}
243
259
}
You can’t perform that action at this time.
0 commit comments