Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
507a29af
Commit
507a29af
authored
Oct 06, 2022
by
tom
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of github.com:blockscout/frontend into tx-page-api
parents
1862b8e5
1b704fec
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
211 additions
and
154 deletions
+211
-154
marketplaceApps.json
data/marketplaceApps.json
+1
-1
Form.ts
theme/components/Form.ts
+88
-122
FormLabel.ts
theme/components/FormLabel.ts
+93
-0
index.ts
theme/components/index.ts
+2
-0
internalTransaction.ts
types/api/internalTransaction.ts
+1
-1
log.ts
types/api/log.ts
+1
-1
rawTrace.ts
types/api/rawTrace.ts
+1
-1
tokenlist.ts
types/api/tokenlist.ts
+1
-1
transaction.ts
types/api/transaction.ts
+9
-9
Apps.tsx
ui/pages/Apps.tsx
+1
-1
MarketplaceApp.tsx
ui/pages/MarketplaceApp.tsx
+3
-3
MyProfile.tsx
ui/pages/MyProfile.tsx
+0
-3
PublicTagFormAddressInput.tsx
ui/publicTags/PublicTagsForm/PublicTagFormAddressInput.tsx
+2
-1
PublicTagFormComment.tsx
ui/publicTags/PublicTagsForm/PublicTagFormComment.tsx
+2
-2
PublicTagsForm.tsx
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
+1
-3
PublicTagsFormInput.tsx
ui/publicTags/PublicTagsForm/PublicTagsFormInput.tsx
+2
-2
AddressInput.tsx
ui/shared/AddressInput.tsx
+2
-2
TxStatus.tsx
ui/shared/TxStatus.tsx
+1
-1
No files found.
data/marketplaceApps.json
View file @
507a29af
...
...
@@ -72,7 +72,7 @@
"github"
:
"https://github.com/mikhin"
},
{
"chainId"
:
1
,
"chainId"
:
1
00
,
"author"
:
"xDaichain"
,
"id"
:
"bao-finance"
,
"title"
:
"Bao Finance"
,
...
...
theme/components/Form.ts
View file @
507a29af
import
{
formAnatomy
as
parts
}
from
'
@chakra-ui/anatomy
'
;
import
{
createMultiStyleConfigHelpers
,
}
from
'
@chakra-ui/styled-system
'
;
import
{
createMultiStyleConfigHelpers
}
from
'
@chakra-ui/styled-system
'
;
import
type
{
StyleFunctionProps
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
,
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
type
{
Dict
}
from
'
@chakra-ui/utils
'
;
import
getDefaultFormColors
from
'
../utils/getDefaultFormColors
'
;
import
FormLabel
from
'
./FormLabel
'
;
import
Input
from
'
./Input
'
;
import
Textarea
from
'
./Textarea
'
;
const
{
definePartsStyle
,
defineMultiStyleConfig
}
=
createMultiStyleConfigHelpers
(
parts
.
keys
);
const
getActiveLabelStyles
=
(
theme
:
Dict
,
fc
:
string
,
bc
:
string
,
size
:
'
md
'
|
'
lg
'
)
=>
{
const
baseStyles
=
{
backgroundColor
:
bc
,
color
:
getColor
(
theme
,
fc
),
fontSize
:
'
xs
'
,
lineHeight
:
'
16px
'
,
borderTopRightRadius
:
'
none
'
,
};
switch
(
size
)
{
case
'
md
'
:
{
return
{
...
baseStyles
,
padding
:
'
10px 16px 2px 16px
'
,
};
}
case
'
lg
'
:
{
return
{
...
baseStyles
,
padding
:
'
16px 24px 2px 24px
'
,
};
}
}
};
const
getDefaultLabelStyles
=
(
size
:
'
md
'
|
'
lg
'
)
=>
{
switch
(
size
)
{
case
'
md
'
:
{
return
{
fontSize
:
'
md
'
,
lineHeight
:
'
20px
'
,
padding
:
'
18px 16px
'
,
right
:
'
18px
'
,
};
}
case
'
lg
'
:
{
return
{
fontSize
:
'
md
'
,
lineHeight
:
'
24px
'
,
padding
:
'
28px 24px
'
,
right
:
'
26px
'
,
};
}
}
};
const
getPaddingX
=
(
size
:
'
md
'
|
'
lg
'
)
=>
{
switch
(
size
)
{
case
'
md
'
:
{
return
'
16px
'
;
}
function
getFloatingVariantStylesForSize
(
size
:
'
md
'
|
'
lg
'
,
props
:
StyleFunctionProps
)
{
const
{
theme
}
=
props
;
const
{
focusColor
:
fc
,
errorColor
:
ec
}
=
getDefaultFormColors
(
props
);
case
'
lg
'
:
{
return
'
24px
'
;
const
activeLabelStyles
=
{
...
FormLabel
.
variants
?.
floating
?.(
props
).
_focusWithin
,
...
FormLabel
.
sizes
?.[
size
](
props
).
_focusWithin
,
}
||
{};
const
activeInputStyles
=
(()
=>
{
switch
(
size
)
{
case
'
md
'
:
{
return
{
paddingTop
:
'
26px
'
,
paddingBottom
:
'
10px
'
,
};
}
case
'
lg
'
:
{
return
{
paddingTop
:
'
38px
'
,
paddingBottom
:
'
18px
'
,
};
}
}
}
};
})();
const
getActiveInputStyles
=
(
size
:
'
md
'
|
'
lg
'
)
=>
{
switch
(
size
)
{
case
'
md
'
:
{
return
{
paddingTop
:
'
26px
'
,
paddingBottom
:
'
10px
'
,
};
}
const
inputPx
=
(()
=>
{
switch
(
size
)
{
case
'
md
'
:
{
return
'
16px
'
;
}
case
'
lg
'
:
{
return
{
paddingTop
:
'
38px
'
,
paddingBottom
:
'
18px
'
,
};
case
'
lg
'
:
{
return
'
24px
'
;
}
}
}
};
const
variantFloating
=
definePartsStyle
((
props
)
=>
{
const
{
theme
,
backgroundColor
,
size
=
'
md
'
}
=
props
;
const
{
focusColor
:
fc
,
errorColor
:
ec
}
=
getDefaultFormColors
(
props
);
const
bc
=
backgroundColor
||
mode
(
'
white
'
,
'
black
'
)(
props
);
const
px
=
getPaddingX
(
size
);
const
activeInputStyles
=
getActiveInputStyles
(
size
);
const
activeLabelStyles
=
getActiveLabelStyles
(
theme
,
fc
,
bc
,
size
);
})();
return
{
container
:
{
// active styles
_focusWithin
:
{
label
:
{
...
activeLabelStyles
,
},
'
input, textarea
'
:
{
...
activeInputStyles
,
},
'
label .chakra-form__required-indicator
'
:
{
color
:
getColor
(
theme
,
fc
),
},
},
// label's styles
label
:
{
...
getDefaultLabelStyles
(
size
),
left
:
'
2px
'
,
top
:
'
2px
'
,
zIndex
:
2
,
position
:
'
absolute
'
,
borderRadius
:
'
base
'
,
boxSizing
:
'
border-box
'
,
color
:
'
gray.500
'
,
backgroundColor
:
'
transparent
'
,
pointerEvents
:
'
none
'
,
margin
:
0
,
transformOrigin
:
'
top left
'
,
transitionProperty
:
'
font-size, line-height, padding, top, background-color
'
,
overflow
:
'
hidden
'
,
whiteSpace
:
'
nowrap
'
,
textOverflow
:
'
ellipsis
'
,
},
'
input:not(:placeholder-shown) + label, textarea:not(:placeholder-shown) + label
'
:
{
...
activeLabelStyles
,
label
:
activeLabelStyles
,
'
input, textarea
'
:
activeInputStyles
,
},
// label styles
label
:
FormLabel
.
sizes
?.[
size
](
props
)
||
{},
'
input:not(:placeholder-shown) + label, textarea:not(:placeholder-shown) + label
'
:
activeLabelStyles
,
'
input[aria-invalid=true] + label, textarea[aria-invalid=true] + label
'
:
{
color
:
getColor
(
theme
,
ec
),
},
// input's styles
// input styles
input
:
Input
.
sizes
?.[
size
].
field
,
textarea
:
Textarea
.
sizes
?.[
size
],
'
input, textarea
'
:
{
padding
:
p
x
,
padding
:
inputP
x
,
},
'
input:not(:placeholder-shown), textarea:not(:placeholder-shown)
'
:
activeInputStyles
,
'
input[disabled] + label, textarea[disabled] + label
'
:
{
backgroundColor
:
'
transparent
'
,
},
'
input:not(:placeholder-shown), textarea:not(:placeholder-shown)
'
:
{
...
activeInputStyles
,
},
// indicator's styles
// indicator styles
'
input:not(:placeholder-shown) + label .chakra-form__required-indicator, textarea:not(:placeholder-shown) + label .chakra-form__required-indicator
'
:
{
color
:
getColor
(
theme
,
fc
),
},
...
...
@@ -153,6 +84,11 @@ const variantFloating = definePartsStyle((props) => {
color
:
getColor
(
theme
,
ec
),
},
},
};
}
const
baseStyle
=
definePartsStyle
((
props
)
=>
{
return
{
requiredIndicator
:
{
marginStart
:
0
,
color
:
mode
(
'
gray.500
'
,
'
whiteAlpha.400
'
)(
props
),
...
...
@@ -160,12 +96,42 @@ const variantFloating = definePartsStyle((props) => {
};
});
const
variantFloating
=
definePartsStyle
((
props
)
=>
{
return
{
container
:
{
label
:
FormLabel
.
variants
?.
floating
(
props
)
||
{},
},
};
});
const
sizes
=
{
lg
:
definePartsStyle
((
props
)
=>
{
if
(
props
.
variant
===
'
floating
'
)
{
return
getFloatingVariantStylesForSize
(
'
lg
'
,
props
);
}
return
{};
}),
md
:
definePartsStyle
((
props
)
=>
{
if
(
props
.
variant
===
'
floating
'
)
{
return
getFloatingVariantStylesForSize
(
'
md
'
,
props
);
}
return
{};
}),
};
const
variants
=
{
floating
:
variantFloating
,
};
const
Form
=
defineMultiStyleConfig
({
baseStyle
,
variants
,
sizes
,
defaultProps
:
{
size
:
'
md
'
,
},
});
export
default
Form
;
theme/components/FormLabel.ts
0 → 100644
View file @
507a29af
import
{
defineStyle
,
defineStyleConfig
}
from
'
@chakra-ui/styled-system
'
;
import
{
getColor
,
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
getDefaultFormColors
from
'
../utils/getDefaultFormColors
'
;
const
baseStyle
=
defineStyle
({
fontSize
:
'
md
'
,
marginEnd
:
'
3
'
,
mb
:
'
2
'
,
fontWeight
:
'
medium
'
,
transitionProperty
:
'
common
'
,
transitionDuration
:
'
normal
'
,
opacity
:
1
,
_disabled
:
{
opacity
:
0.4
,
},
});
const
variantFloating
=
defineStyle
((
props
)
=>
{
const
{
theme
,
backgroundColor
}
=
props
;
const
{
focusColor
:
fc
}
=
getDefaultFormColors
(
props
);
const
bc
=
backgroundColor
||
mode
(
'
white
'
,
'
black
'
)(
props
);
return
{
left
:
'
2px
'
,
top
:
'
2px
'
,
zIndex
:
2
,
position
:
'
absolute
'
,
borderRadius
:
'
base
'
,
boxSizing
:
'
border-box
'
,
color
:
'
gray.500
'
,
backgroundColor
:
'
transparent
'
,
pointerEvents
:
'
none
'
,
margin
:
0
,
transformOrigin
:
'
top left
'
,
transitionProperty
:
'
font-size, line-height, padding, top, background-color
'
,
overflow
:
'
hidden
'
,
whiteSpace
:
'
nowrap
'
,
textOverflow
:
'
ellipsis
'
,
_focusWithin
:
{
backgroundColor
:
bc
,
color
:
getColor
(
theme
,
fc
),
fontSize
:
'
xs
'
,
lineHeight
:
'
16px
'
,
borderTopRightRadius
:
'
none
'
,
},
};
});
const
variants
=
{
floating
:
variantFloating
,
};
const
sizes
=
{
lg
:
defineStyle
((
props
)
=>
{
if
(
props
.
variant
===
'
floating
'
)
{
return
{
fontSize
:
'
md
'
,
lineHeight
:
'
24px
'
,
padding
:
'
28px 24px
'
,
right
:
'
26px
'
,
_focusWithin
:
{
padding
:
'
16px 24px 2px 24px
'
,
},
};
}
return
{};
}),
md
:
defineStyle
((
props
)
=>
{
if
(
props
.
variant
===
'
floating
'
)
{
return
{
fontSize
:
'
md
'
,
lineHeight
:
'
20px
'
,
padding
:
'
18px 16px
'
,
right
:
'
18px
'
,
_focusWithin
:
{
padding
:
'
10px 16px 2px 16px
'
,
},
};
}
return
{};
}),
};
const
FormLabel
=
defineStyleConfig
({
variants
,
baseStyle
,
sizes
,
});
export
default
FormLabel
;
theme/components/index.ts
View file @
507a29af
...
...
@@ -4,6 +4,7 @@ import Button from './Button';
import
Checkbox
from
'
./Checkbox
'
;
import
Drawer
from
'
./Drawer
'
;
import
Form
from
'
./Form
'
;
import
FormLabel
from
'
./FormLabel
'
;
import
Heading
from
'
./Heading
'
;
import
Input
from
'
./Input
'
;
import
Link
from
'
./Link
'
;
...
...
@@ -27,6 +28,7 @@ const components = {
Heading
,
Input
,
Form
,
FormLabel
,
Link
,
Modal
,
Popover
,
...
...
types/api/internalTransaction.ts
View file @
507a29af
...
...
@@ -3,7 +3,7 @@ import type { AddressParam } from './addressParams';
export
type
TxInternalsType
=
'
call
'
|
'
delegatecall
'
|
'
staticcall
'
|
'
create
'
|
'
create2
'
|
'
selfdestruct
'
|
'
reward
'
export
interface
InternalTransaction
{
error
?:
string
;
error
:
string
|
null
;
success
:
boolean
;
type
:
TxInternalsType
;
transaction_hash
:
string
;
...
...
types/api/log.ts
View file @
507a29af
...
...
@@ -6,7 +6,7 @@ export interface Log {
topics
:
Array
<
string
>
;
data
:
string
;
index
:
number
;
decoded
?:
DecodedInput
;
decoded
:
DecodedInput
|
null
;
}
export
interface
LogsResponse
{
...
...
types/api/rawTrace.ts
View file @
507a29af
...
...
@@ -11,7 +11,7 @@ export interface RawTrace {
gasUsed
:
string
;
output
:
string
;
};
error
?:
string
;
error
:
string
|
null
;
subtraces
:
number
;
traceAddress
:
Array
<
number
>
;
type
:
string
;
...
...
types/api/tokenlist.ts
View file @
507a29af
...
...
@@ -6,7 +6,7 @@ export type Tokenlist = {
export
type
TokenlistItem
=
{
balance
:
number
;
contractAddress
:
string
;
decimals
?:
number
;
decimals
:
number
|
null
;
id
:
number
;
name
:
string
;
symbol
:
string
;
...
...
types/api/transaction.ts
View file @
507a29af
...
...
@@ -20,20 +20,20 @@ export interface Transaction {
type
:
number
;
gas_used
:
string
;
gas_limit
:
string
;
max_fee_per_gas
?:
number
;
max_priority_fee_per_gas
?:
number
;
priority_fee
?:
number
;
base_fee_per_gas
?:
number
;
tx_burnt_fee
?:
number
;
max_fee_per_gas
:
number
|
null
;
max_priority_fee_per_gas
:
number
|
null
;
priority_fee
:
number
|
null
;
base_fee_per_gas
:
number
|
null
;
tx_burnt_fee
:
number
|
null
;
nonce
:
number
;
position
:
number
;
revert_reason
?
:
{
revert_reason
:
{
raw
:
string
;
decoded
:
string
;
};
}
|
null
;
raw_input
:
string
;
decoded_input
?:
DecodedInput
;
token_transfers
?:
Array
<
TokenTransfer
>
;
decoded_input
:
DecodedInput
|
null
;
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
token_transfers_overflow
:
boolean
;
exchange_rate
:
string
;
}
...
...
ui/pages/Apps.tsx
View file @
507a29af
...
...
@@ -23,7 +23,7 @@ const Apps = () => {
setDisplayedAppId
(
id
);
},
[]);
// eslint-disable-next-line react-hooks/exhaustive-deps
const
debounceFilterApps
=
useCallback
(
debounce
(
q
=>
filterApps
(
q
),
500
),
[]);
const
debounceFilterApps
=
useCallback
(
debounce
(
q
=>
filterApps
(
q
),
500
),
[
defaultAppList
]);
const
clearDisplayedAppId
=
useCallback
(()
=>
setDisplayedAppId
(
null
),
[]);
function
filterApps
(
q
:
string
)
{
...
...
ui/pages/MarketplaceApp.tsx
View file @
507a29af
...
...
@@ -27,10 +27,10 @@ const MarketplaceApp = ({ app, isLoading }: Props) => {
'
allow-top-navigation-by-user-activation
'
;
useEffect
(()
=>
{
if
(
app
)
{
ref
?.
current
?.
contentWindow
?.
postMessage
({
colorMode
,
chaind
Id
:
network
?.
chainId
},
app
.
url
);
if
(
app
&&
!
isFrameLoading
)
{
ref
?.
current
?.
contentWindow
?.
postMessage
({
blockscoutColorMode
:
colorMode
,
blockscoutChain
Id
:
network
?.
chainId
},
app
.
url
);
}
},
[
app
,
colorMode
,
network
,
ref
]);
},
[
isFrameLoading
,
app
,
colorMode
,
network
,
ref
]);
return
(
<
Page
wrapChildren=
{
false
}
>
...
...
ui/pages/MyProfile.tsx
View file @
507a29af
...
...
@@ -25,7 +25,6 @@ const MyProfile = () => {
<
UserAvatar
size=
{
64
}
data=
{
data
}
/>
<
FormControl
variant=
"floating"
id=
"name"
isRequired
size=
"lg"
>
<
Input
size=
"lg"
required
disabled
value=
{
data
.
name
||
''
}
...
...
@@ -34,7 +33,6 @@ const MyProfile = () => {
</
FormControl
>
<
FormControl
variant=
"floating"
id=
"nickname"
isRequired
size=
"lg"
>
<
Input
size=
"lg"
required
disabled
value=
{
data
.
nickname
||
''
}
...
...
@@ -43,7 +41,6 @@ const MyProfile = () => {
</
FormControl
>
<
FormControl
variant=
"floating"
id=
"email"
isRequired
size=
"lg"
>
<
Input
size=
"lg"
required
disabled
value=
{
data
.
email
}
...
...
ui/publicTags/PublicTagsForm/PublicTagFormAddressInput.tsx
View file @
507a29af
import
type
{
InputProps
}
from
'
@chakra-ui/react
'
;
import
{
IconButton
,
Icon
,
Flex
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
ControllerRenderProps
,
Control
,
FieldError
}
from
'
react-hook-form
'
;
...
...
@@ -17,7 +18,7 @@ interface Props {
error
?:
FieldError
;
onAddFieldClick
:
(
e
:
React
.
SyntheticEvent
)
=>
void
;
onRemoveFieldClick
:
(
index
:
number
)
=>
(
e
:
React
.
SyntheticEvent
)
=>
void
;
size
?:
string
;
size
?:
InputProps
[
'
size
'
]
;
}
const
MAX_INPUTS_NUM
=
10
;
...
...
ui/publicTags/PublicTagsForm/PublicTagFormComment.tsx
View file @
507a29af
import
type
{
InputProps
}
from
'
@chakra-ui/react
'
;
import
{
FormControl
,
FormLabel
,
Textarea
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
ControllerRenderProps
,
Control
,
FieldError
}
from
'
react-hook-form
'
;
...
...
@@ -12,7 +13,7 @@ const TEXT_INPUT_MAX_LENGTH = 255;
interface
Props
{
control
:
Control
<
Inputs
>
;
error
?:
FieldError
;
size
?:
string
;
size
?:
InputProps
[
'
size
'
]
;
}
export
default
function
PublicTagFormComment
({
control
,
error
,
size
}:
Props
)
{
...
...
@@ -22,7 +23,6 @@ export default function PublicTagFormComment({ control, error, size }: Props) {
<
Textarea
{
...
field
}
isInvalid=
{
Boolean
(
error
)
}
size=
{
size
}
/>
<
FormLabel
>
{
getPlaceholderWithError
(
'
Specify the reason for adding tags and color preference(s)
'
,
error
?.
message
)
}
...
...
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
View file @
507a29af
...
...
@@ -16,7 +16,6 @@ import type { PublicTags, PublicTag, PublicTagNew, PublicTagErrors } from 'types
import
getErrorMessage
from
'
lib/getErrorMessage
'
;
import
type
{
ErrorType
}
from
'
lib/hooks/useFetch
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
EMAIL_REGEXP
}
from
'
lib/validations/email
'
;
import
FormSubmitAlert
from
'
ui/shared/FormSubmitAlert
'
;
...
...
@@ -57,9 +56,8 @@ const ADDRESS_INPUT_BUTTONS_WIDTH = 100;
const
PublicTagsForm
=
({
changeToDataScreen
,
data
}:
Props
)
=>
{
const
queryClient
=
useQueryClient
();
const
isMobile
=
useIsMobile
();
const
fetch
=
useFetch
();
const
inputSize
=
isMobile
?
'
md
'
:
'
lg
'
;
const
inputSize
=
{
base
:
'
md
'
,
lg
:
'
lg
'
}
;
const
{
control
,
handleSubmit
,
formState
:
{
errors
,
isValid
},
setError
}
=
useForm
<
Inputs
>
({
defaultValues
:
{
...
...
ui/publicTags/PublicTagsForm/PublicTagsFormInput.tsx
View file @
507a29af
import
type
{
InputProps
}
from
'
@chakra-ui/react
'
;
import
{
FormControl
,
FormLabel
,
Input
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
ControllerRenderProps
,
FieldError
,
FieldValues
,
Path
,
Control
}
from
'
react-hook-form
'
;
...
...
@@ -14,7 +15,7 @@ interface Props<TInputs extends FieldValues> {
control
:
Control
<
TInputs
,
object
>
;
pattern
?:
RegExp
;
error
?:
FieldError
;
size
?:
string
;
size
?:
InputProps
[
'
size
'
]
;
}
export
default
function
PublicTagsFormInput
<
Inputs
extends
FieldValues
>
({
...
...
@@ -31,7 +32,6 @@ export default function PublicTagsFormInput<Inputs extends FieldValues>({
<
FormControl
variant=
"floating"
id=
{
field
.
name
}
isRequired=
{
required
}
size=
{
size
}
>
<
Input
{
...
field
}
size=
{
size
}
required=
{
required
}
isInvalid=
{
Boolean
(
error
)
}
maxLength=
{
TEXT_INPUT_MAX_LENGTH
}
...
...
ui/shared/AddressInput.tsx
View file @
507a29af
import
type
{
InputProps
}
from
'
@chakra-ui/react
'
;
import
{
Input
,
FormControl
,
...
...
@@ -11,7 +12,7 @@ import { ADDRESS_LENGTH } from 'lib/validations/address';
type
Props
<
TInputs
extends
FieldValues
,
TInputName
extends
Path
<
TInputs
>>
=
{
field
:
ControllerRenderProps
<
TInputs
,
TInputName
>
;
size
?:
string
;
size
?:
InputProps
[
'
size
'
]
;
placeholder
?:
string
;
backgroundColor
?:
string
;
error
?:
FieldError
;
...
...
@@ -31,7 +32,6 @@ export default function AddressInput<Inputs extends FieldValues, Name extends Pa
{
...
field
}
isInvalid=
{
Boolean
(
error
)
}
maxLength=
{
ADDRESS_LENGTH
}
size=
{
size
}
/>
<
FormLabel
>
{
getPlaceholderWithError
(
placeholder
,
error
?.
message
)
}
</
FormLabel
>
</
FormControl
>
...
...
ui/shared/TxStatus.tsx
View file @
507a29af
...
...
@@ -9,7 +9,7 @@ import successIcon from 'icons/status/success.svg';
export
interface
Props
{
status
:
Transaction
[
'
status
'
];
errorText
?:
string
;
errorText
?:
string
|
null
;
}
const
TxStatus
=
({
status
,
errorText
}:
Props
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment