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
2750d34d
Commit
2750d34d
authored
Mar 26, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update styles for progress circle, pagination, dialog and file upload
parent
1970d436
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
80 additions
and
77 deletions
+80
-77
metamask.svg
icons/wallets/metamask.svg
+14
-12
semanticTokens.ts
toolkit/theme/foundations/semanticTokens.ts
+2
-2
dialog.recipe.ts
toolkit/theme/recipes/dialog.recipe.ts
+2
-1
progress-circle.recipe.ts
toolkit/theme/recipes/progress-circle.recipe.ts
+13
-4
AddressVerificationStepSignature.tsx
...ssVerification/steps/AddressVerificationStepSignature.tsx
+1
-1
ContractVerificationFieldSources.tsx
...tVerification/fields/ContractVerificationFieldSources.tsx
+12
-6
GasTracker.tsx
ui/pages/GasTracker.tsx
+0
-1
Hint.tsx
ui/shared/Hint.tsx
+3
-1
DragAndDropArea.tsx
ui/shared/forms/inputs/file/DragAndDropArea.tsx
+9
-8
FileSnippet.tsx
ui/shared/forms/inputs/file/FileSnippet.tsx
+7
-26
GasInfoTooltip.tsx
ui/shared/gas/GasInfoTooltip.tsx
+2
-2
Pagination.tsx
ui/shared/pagination/Pagination.tsx
+6
-8
Dialog.tsx
ui/showcases/Dialog.tsx
+6
-3
ProgressCircle.tsx
ui/showcases/ProgressCircle.tsx
+3
-2
No files found.
icons/wallets/metamask.svg
View file @
2750d34d
<svg
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 20 20"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 20 20"
>
<path
fill=
"#E2761B"
d=
"M19.004 1 11.2 6.82l1.443-3.434L19.003 1Z"
/>
<g
clip-path=
"url(#a)"
>
<path
fill=
"#E4761B"
d=
"M.988 1 8.73 6.875 7.357 3.386.988 1Zm15.208 13.492-2.078 3.197 4.447 1.229 1.278-4.356-3.647-.07Zm-16.031.07 1.27 4.356 4.447-1.229-2.078-3.197-3.64.07Z"
/>
<path
fill=
"#FF5C16"
d=
"m17.763 17.7-3.864-1.15-2.914 1.742H8.952L6.037 16.55 2.175 17.7 1 13.736l1.175-4.402L1 5.613 2.175 1l6.034 3.605h3.519L17.763 1l1.175 4.612-1.175 3.721 1.175 4.402-1.175 3.966Z"
/>
<path
fill=
"#E4761B"
d=
"m5.631 9.088-1.239 1.883 4.416.197-.157-4.765-3.02 2.685Zm8.73 0-3.06-2.74-.101 4.82 4.408-.197-1.247-1.883ZM5.882 17.69l2.651-1.3-2.29-1.795-.36 3.095Zm5.577-1.3 2.659 1.3-.369-3.095-2.29 1.796Z"
/>
<path
fill=
"#FF5C16"
d=
"M2.176 1 8.21 4.608l-.24 2.476L2.176 1Zm3.862 12.737 2.655 2.022-2.655.791v-2.813Zm2.443-3.344-.51-3.307-3.267 2.249-.002-.001v.001l.01 2.315 1.325-1.257H8.48ZM17.763 1l-6.035 3.608.24 2.476L17.762 1ZM13.9 13.737l-2.656 2.022 2.656.791v-2.813Zm1.335-4.402v-.002l-.001.001-3.267-2.248-.51 3.307H13.9l1.325 1.257.01-2.315Z"
/>
<path
fill=
"#D7C1B3"
d=
"m14.118 17.69-2.66-1.3.213 1.74-.024.733 2.47-1.174Zm-8.236 0 2.47 1.173-.015-.733.196-1.74-2.65 1.3Z"
/>
<path
fill=
"#E34807"
d=
"M6.037 16.55 2.175 17.7 1 13.737h5.037v2.814Zm2.443-6.159.738 4.781-1.023-2.658-3.485-.865 1.326-1.257H8.48Zm5.42 6.159 3.863 1.15 1.175-3.964H13.9v2.814Zm-2.442-6.159-.738 4.781 1.022-2.658 3.485-.865-1.326-1.257h-2.443Z"
/>
<path
fill=
"#233447"
d=
"M8.392 13.444 6.18 12.79l1.561-.716.651 1.37Zm3.208 0 .651-1.37 1.569.716-2.22.654Z"
/>
<path
fill=
"#FF8D5D"
d=
"m1 13.735 1.175-4.402H4.7l.01 2.316 3.484.864 1.023 2.658-.526.586-2.655-2.023H1Zm17.938 0-1.175-4.402h-2.527l-.009 2.316-3.485.864-1.022 2.658.525.586 2.656-2.023h5.037Zm-7.21-9.13H8.209l-.238 2.476 1.247 8.088h1.502l1.248-8.088-.24-2.476Z"
/>
<path
fill=
"#CD6116"
d=
"m5.882 17.69.377-3.199-2.455.071 2.078 3.127Zm7.86-3.199.376 3.198 2.078-3.127-2.455-.07Zm1.866-3.52-4.408.197.408 2.276.65-1.37 1.57.716 1.78-1.82ZM6.18 12.79l1.57-.717.642 1.37.416-2.276-4.416-.197 1.788 1.82Z"
/>
<path
fill=
"#661800"
d=
"M2.175 1 1 5.612l1.175 3.721H4.7l3.27-2.249L2.175 1ZM7.75 11.352H6.605l-.623.61 2.214.55-.446-1.16ZM17.763 1l1.175 4.612-1.175 3.721h-2.527l-3.268-2.249L17.763 1Zm-5.574 10.352h1.147l.623.611-2.217.55.447-1.162Zm-1.205 5.363.261-.957-.525-.585H9.217l-.526.585.261.957"
/>
<path
fill=
"#E4751F"
d=
"m4.392 10.97 1.851 3.624-.063-1.804-1.788-1.82Zm9.435 1.82-.078 1.804 1.859-3.623-1.78 1.82Zm-5.02-1.622-.415 2.276.518 2.686.117-3.537-.22-1.425Zm2.393 0-.212 1.418.094 3.544.526-2.686-.408-2.276Z"
/>
<path
fill=
"#C0C4CD"
d=
"M10.984 16.714v1.579H8.952v-1.579h2.032Z"
/>
<path
fill=
"#F6851B"
d=
"m11.608 13.444-.526 2.686.377.26 2.29-1.796.079-1.804-2.22.654ZM6.18 12.79l.063 1.804 2.29 1.796.377-.26-.518-2.686-2.212-.654Z"
/>
<path
fill=
"#E7EBF6"
d=
"m6.038 16.548 2.916 1.744v-1.579l-.261-.956-2.655.791Zm7.863 0-2.917 1.744v-1.579l.262-.956 2.655.791Z"
/>
<path
fill=
"#C0AD9E"
d=
"m11.647 18.863.024-.733-.196-.173H8.518l-.18.173.015.733-2.47-1.174.862.709 1.75 1.22h3.003l1.757-1.22.863-.709-2.471 1.174Z"
/>
</g>
<path
fill=
"#161616"
d=
"m11.459 16.39-.377-.26H8.91l-.377.26-.196 1.74.18-.173h2.957l.197.173-.212-1.74Z"
/>
<defs>
<path
fill=
"#763D16"
d=
"M19.333 7.198 20 3.985 19.004 1l-7.545 5.623L14.36 9.09l4.102 1.205.91-1.064-.393-.283.628-.575-.486-.378.627-.48-.416-.316ZM0 3.985l.667 3.213-.424.315.628.48-.479.379.628.575-.393.283.902 1.064 4.102-1.205 2.902-2.466L.988 1 0 3.985Z"
/>
<clipPath
id=
"a"
>
<path
fill=
"#F6851B"
d=
"M18.463 10.294 14.36 9.089l1.247 1.882-1.859 3.623 2.447-.031h3.647l-1.38-4.27ZM5.63 9.089l-4.1 1.205-1.365 4.268h3.639l2.44.032-1.852-3.623 1.24-1.882Zm5.57 2.079.258-4.545 1.192-3.237H7.357l1.176 3.237.275 4.545.094 1.433.008 3.529h2.172l.016-3.529.102-1.433Z"
/>
<path
fill=
"#fff"
d=
"M1 1h18v17.366H1z"
/>
</clipPath>
</defs>
</svg>
</svg>
toolkit/theme/foundations/semanticTokens.ts
View file @
2750d34d
...
@@ -9,7 +9,7 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
...
@@ -9,7 +9,7 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
button
:
{
button
:
{
outline
:
{
outline
:
{
fg
:
{
fg
:
{
DEFAULT
:
{
value
:
{
_light
:
'
{colors.blue.600}
'
,
_dark
:
'
{colors.blue.
3
00}
'
}
},
DEFAULT
:
{
value
:
{
_light
:
'
{colors.blue.600}
'
,
_dark
:
'
{colors.blue.
6
00}
'
}
},
},
},
},
},
subtle
:
{
subtle
:
{
...
@@ -168,7 +168,7 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
...
@@ -168,7 +168,7 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
},
},
progressCircle
:
{
progressCircle
:
{
trackColor
:
{
trackColor
:
{
DEFAULT
:
{
value
:
{
_light
:
'
{colors.
blackAlpha.5
0}
'
,
_dark
:
'
{colors.whiteAlpha.100}
'
}
},
DEFAULT
:
{
value
:
{
_light
:
'
{colors.
gray.10
0}
'
,
_dark
:
'
{colors.whiteAlpha.100}
'
}
},
},
},
},
},
skeleton
:
{
skeleton
:
{
...
...
toolkit/theme/recipes/dialog.recipe.ts
View file @
2750d34d
...
@@ -61,6 +61,7 @@ export const recipe = defineSlotRecipe({
...
@@ -61,6 +61,7 @@ export const recipe = defineSlotRecipe({
display
:
'
flex
'
,
display
:
'
flex
'
,
alignItems
:
'
center
'
,
alignItems
:
'
center
'
,
columnGap
:
2
,
columnGap
:
2
,
minH
:
'
40px
'
,
},
},
body
:
{
body
:
{
flex
:
'
1
'
,
flex
:
'
1
'
,
...
@@ -70,7 +71,7 @@ export const recipe = defineSlotRecipe({
...
@@ -70,7 +71,7 @@ export const recipe = defineSlotRecipe({
display
:
'
flex
'
,
display
:
'
flex
'
,
alignItems
:
'
center
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
,
justifyContent
:
'
flex-start
'
,
gap
:
'
3
'
,
gap
:
'
6
'
,
p
:
'
0
'
,
p
:
'
0
'
,
mt
:
'
6
'
,
mt
:
'
6
'
,
},
},
...
...
toolkit/theme/recipes/progress-circle.recipe.ts
View file @
2750d34d
...
@@ -40,22 +40,31 @@ export const recipe = defineSlotRecipe({
...
@@ -40,22 +40,31 @@ export const recipe = defineSlotRecipe({
size
:
{
size
:
{
sm
:
{
sm
:
{
circle
:
{
circle
:
{
'
--size
'
:
'
16
px
'
,
'
--size
'
:
'
20
px
'
,
'
--thickness
'
:
'
2px
'
,
'
--thickness
'
:
'
2px
'
,
},
},
valueText
:
{
valueText
:
{
textStyle
:
'
2
xs
'
,
textStyle
:
'
xs
'
,
},
},
},
},
md
:
{
md
:
{
circle
:
{
circle
:
{
'
--size
'
:
'
20
px
'
,
'
--size
'
:
'
32
px
'
,
'
--thickness
'
:
'
2
px
'
,
'
--thickness
'
:
'
3
px
'
,
},
},
valueText
:
{
valueText
:
{
textStyle
:
'
xs
'
,
textStyle
:
'
xs
'
,
},
},
},
},
lg
:
{
circle
:
{
'
--size
'
:
'
80px
'
,
'
--thickness
'
:
'
8px
'
,
},
valueText
:
{
textStyle
:
'
sm
'
,
},
},
},
},
},
},
...
...
ui/addressVerification/steps/AddressVerificationStepSignature.tsx
View file @
2750d34d
...
@@ -219,7 +219,7 @@ const AddressVerificationStepSignature = ({ address, signingMessage, contractCre
...
@@ -219,7 +219,7 @@ const AddressVerificationStepSignature = ({ address, signingMessage, contractCre
)
}
)
}
<
Flex
rowGap=
{
5
}
flexDir=
"column"
>
<
Flex
rowGap=
{
5
}
flexDir=
"column"
>
<
div
>
<
div
>
<
CopyToClipboard
text=
{
signingMessage
}
ml=
"auto"
mb=
{
2
}
/>
<
CopyToClipboard
text=
{
signingMessage
}
ml=
"auto"
/>
<
FormFieldText
<
Fields
>
<
FormFieldText
<
Fields
>
name="message"
name="message"
placeholder="Message to sign"
placeholder="Message to sign"
...
...
ui/contractVerification/fields/ContractVerificationFieldSources.tsx
View file @
2750d34d
import
{
Text
,
Box
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Text
,
Box
,
Flex
,
VStack
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
ControllerRenderProps
,
FieldPathValue
,
ValidateResult
}
from
'
react-hook-form
'
;
import
type
{
ControllerRenderProps
,
FieldPathValue
,
ValidateResult
}
from
'
react-hook-form
'
;
import
{
Controller
,
useFormContext
}
from
'
react-hook-form
'
;
import
{
Controller
,
useFormContext
}
from
'
react-hook-form
'
;
...
@@ -55,12 +55,12 @@ const ContractVerificationFieldSources = ({ fileTypes, multiple, required, title
...
@@ -55,12 +55,12 @@ const ContractVerificationFieldSources = ({ fileTypes, multiple, required, title
const
renderUploadButton
=
React
.
useCallback
(()
=>
{
const
renderUploadButton
=
React
.
useCallback
(()
=>
{
return
(
return
(
<
div
>
<
VStack
gap=
{
3
}
>
<
Text
fontWeight=
{
500
}
color=
"text.secondary"
mb=
{
3
}
>
{
title
}
</
Text
>
<
Text
fontWeight=
{
500
}
>
{
title
}
</
Text
>
<
Button
size=
"sm"
variant=
"outline"
>
<
Button
size=
"sm"
variant=
"outline"
>
Drop file
{
multiple
?
'
s
'
:
''
}
or click here
Drop file
{
multiple
?
'
s
'
:
''
}
or click here
</
Button
>
</
Button
>
</
div
>
</
VStack
>
);
);
},
[
multiple
,
title
]);
},
[
multiple
,
title
]);
...
@@ -116,7 +116,13 @@ const ContractVerificationFieldSources = ({ fileTypes, multiple, required, title
...
@@ -116,7 +116,13 @@ const ContractVerificationFieldSources = ({ fileTypes, multiple, required, title
rowGap=
{
2
}
rowGap=
{
2
}
w=
"100%"
w=
"100%"
>
>
<
DragAndDropArea
onDrop=
{
onChange
}
fullFilePath=
{
fullFilePath
}
p=
{
{
base
:
3
,
lg
:
6
}
}
isDisabled=
{
formState
.
isSubmitting
}
>
<
DragAndDropArea
onDrop=
{
onChange
}
fullFilePath=
{
fullFilePath
}
p=
{
{
base
:
3
,
lg
:
6
}
}
isDisabled=
{
formState
.
isSubmitting
}
isInvalid=
{
Boolean
(
error
)
}
>
{
hasValue
?
renderFiles
(
field
.
value
)
:
renderUploadButton
()
}
{
hasValue
?
renderFiles
(
field
.
value
)
:
renderUploadButton
()
}
</
DragAndDropArea
>
</
DragAndDropArea
>
</
Flex
>
</
Flex
>
...
@@ -125,7 +131,7 @@ const ContractVerificationFieldSources = ({ fileTypes, multiple, required, title
...
@@ -125,7 +131,7 @@ const ContractVerificationFieldSources = ({ fileTypes, multiple, required, title
{
errorElement
}
{
errorElement
}
</>
</>
);
);
},
[
fileTypes
,
multiple
,
commonError
,
formState
.
isSubmitting
,
renderFiles
,
renderUploadButton
,
fullFilePath
]);
},
[
fileTypes
,
multiple
,
commonError
?.
type
,
commonError
?.
message
,
fullFilePath
,
formState
.
isSubmitting
,
error
,
renderFiles
,
renderUploadButton
]);
const
validateFileType
=
React
.
useCallback
(
async
(
value
:
FieldPathValue
<
FormFields
,
typeof
name
>
):
Promise
<
ValidateResult
>
=>
{
const
validateFileType
=
React
.
useCallback
(
async
(
value
:
FieldPathValue
<
FormFields
,
typeof
name
>
):
Promise
<
ValidateResult
>
=>
{
if
(
Array
.
isArray
(
value
))
{
if
(
Array
.
isArray
(
value
))
{
...
...
ui/pages/GasTracker.tsx
View file @
2750d34d
...
@@ -56,7 +56,6 @@ const GasTracker = () => {
...
@@ -56,7 +56,6 @@ const GasTracker = () => {
key=
{
dataUpdatedAt
}
key=
{
dataUpdatedAt
}
startTime=
{
dataUpdatedAt
}
startTime=
{
dataUpdatedAt
}
duration=
{
data
.
gas_prices_update_in
}
duration=
{
data
.
gas_prices_update_in
}
size=
"md"
ml=
{
2
}
ml=
{
2
}
/>
/>
)
}
)
}
...
...
ui/shared/Hint.tsx
View file @
2750d34d
...
@@ -29,8 +29,10 @@ const Hint = ({ label, className, tooltipProps, isLoading, as }: Props) => {
...
@@ -29,8 +29,10 @@ const Hint = ({ label, className, tooltipProps, isLoading, as }: Props) => {
loadingSkeleton=
{
isLoading
}
loadingSkeleton=
{
isLoading
}
borderRadius=
"sm"
borderRadius=
"sm"
as=
{
as
}
as=
{
as
}
color=
"icon.info"
_hover=
{
{
color
:
'
link.primary.hover
'
}
}
>
>
<
IconSvg
name=
"info"
w=
"100%"
h=
"100%"
color=
"icon.info"
_hover=
{
{
color
:
'
link.primary.hover
'
}
}
/>
<
IconSvg
name=
"info"
w=
"100%"
h=
"100%"
/>
</
IconButton
>
</
IconButton
>
</
Tooltip
>
</
Tooltip
>
);
);
...
...
ui/shared/forms/inputs/file/DragAndDropArea.tsx
View file @
2750d34d
...
@@ -9,10 +9,11 @@ interface Props {
...
@@ -9,10 +9,11 @@ interface Props {
onDrop
:
(
files
:
Array
<
File
>
)
=>
void
;
onDrop
:
(
files
:
Array
<
File
>
)
=>
void
;
className
?:
string
;
className
?:
string
;
isDisabled
?:
boolean
;
isDisabled
?:
boolean
;
isInvalid
?:
boolean
;
fullFilePath
?:
boolean
;
fullFilePath
?:
boolean
;
}
}
const
DragAndDropArea
=
({
onDrop
,
children
,
className
,
isDisabled
,
fullFilePath
}:
Props
)
=>
{
const
DragAndDropArea
=
({
onDrop
,
children
,
className
,
isDisabled
,
fullFilePath
,
isInvalid
}:
Props
)
=>
{
const
[
isDragOver
,
setIsDragOver
]
=
React
.
useState
(
false
);
const
[
isDragOver
,
setIsDragOver
]
=
React
.
useState
(
false
);
const
handleDrop
=
React
.
useCallback
(
async
(
event
:
DragEvent
<
HTMLDivElement
>
)
=>
{
const
handleDrop
=
React
.
useCallback
(
async
(
event
:
DragEvent
<
HTMLDivElement
>
)
=>
{
...
@@ -50,23 +51,23 @@ const DragAndDropArea = ({ onDrop, children, className, isDisabled, fullFilePath
...
@@ -50,23 +51,23 @@ const DragAndDropArea = ({ onDrop, children, className, isDisabled, fullFilePath
}
}
},
[
isDisabled
]);
},
[
isDisabled
]);
const
disabledBorderColor
=
{
_light
:
'
blackAlpha.200
'
,
_dark
:
'
whiteAlpha.200
'
};
const
borderColor
=
isDragOver
?
'
link.primary.hover
'
:
'
link.primary
'
;
return
(
return
(
<
Center
<
Center
className=
{
className
}
className=
{
className
}
w=
"100%"
w=
"100%"
minH=
"120px"
minH=
"120px"
borderWidth=
"2px"
borderWidth=
"2px"
borderColor=
{
isDisabled
?
disabledBorderColor
:
borderColor
}
_hover=
{
{
borderColor
:
isDisabled
?
disabledBorderColor
:
'
link.primary.hover
'
,
}
}
borderRadius=
"base"
borderRadius=
"base"
borderStyle=
"dashed"
borderStyle=
"dashed"
borderColor=
{
isDragOver
?
'
input.border.hover
'
:
'
input.border
'
}
cursor=
"pointer"
cursor=
"pointer"
textAlign=
"center"
textAlign=
"center"
{
...
(
isDisabled
?
{
'
data
-
disabled
':
true
}
:
{})
}
{
...
(
isInvalid
?
{
'
data
-
invalid
':
true
}
:
{})
}
color=
"input.placeholder"
_disabled=
{
{
opacity
:
'
control.disabled
'
}
}
_invalid=
{
{
borderColor
:
'
input.border.error
'
,
color
:
'
input.placeholder.error
'
}
}
_hover=
{
{
borderColor
:
'
input.border.hover
'
}
}
onClick=
{
handleClick
}
onClick=
{
handleClick
}
onDrop=
{
handleDrop
}
onDrop=
{
handleDrop
}
onDragOver=
{
handleDragOver
}
onDragOver=
{
handleDragOver
}
...
...
ui/shared/forms/inputs/file/FileSnippet.tsx
View file @
2750d34d
...
@@ -2,7 +2,7 @@ import { Box, Flex, Text, chakra } from '@chakra-ui/react';
...
@@ -2,7 +2,7 @@ import { Box, Flex, Text, chakra } from '@chakra-ui/react';
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
CloseButton
}
from
'
toolkit/chakra/close-button
'
;
import
{
CloseButton
}
from
'
toolkit/chakra/close-button
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
import
Hint
from
'
ui/shared/Hint
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -36,11 +36,6 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
...
@@ -36,11 +36,6 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
onRemove
?.(
index
);
onRemove
?.(
index
);
},
[
index
,
onRemove
]);
},
[
index
,
onRemove
]);
const
handleErrorHintIconClick
=
React
.
useCallback
((
event
:
React
.
MouseEvent
)
=>
{
event
.
stopPropagation
();
},
[]);
const
fileExtension
=
getFileExtension
(
file
.
name
);
const
fileExtension
=
getFileExtension
(
file
.
name
);
const
fileIcon
=
FILE_ICONS
[
fileExtension
]
||
'
files/placeholder
'
;
const
fileIcon
=
FILE_ICONS
[
fileExtension
]
||
'
files/placeholder
'
;
...
@@ -51,16 +46,12 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
...
@@ -51,16 +46,12 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
className=
{
className
}
className=
{
className
}
alignItems=
"center"
alignItems=
"center"
textAlign=
"left"
textAlign=
"left"
columnGap=
{
2
}
>
>
<
IconSvg
<
IconSvg
name=
{
fileIcon
}
name=
{
fileIcon
}
boxSize=
"74px"
boxSize=
"48px"
color=
{
error
?
'
text.error
'
:
{
_light
:
'
gray.600
'
,
_dark
:
'
gray.400
'
}
}
color=
{
error
?
'
text.error
'
:
'
initial
'
}
mr=
{
2
}
borderWidth=
"2px"
borderRadius=
"md"
borderColor=
{
{
_light
:
'
blackAlpha.100
'
,
_dark
:
'
whiteAlpha.200
'
}
}
p=
{
3
}
/>
/>
<
Box
maxW=
"calc(100% - 58px - 24px)"
>
<
Box
maxW=
"calc(100% - 58px - 24px)"
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
...
@@ -73,25 +64,15 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
...
@@ -73,25 +64,15 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
>
>
{
file
.
name
}
{
file
.
name
}
</
Text
>
</
Text
>
{
Boolean
(
error
)
&&
(
{
Boolean
(
error
)
&&
<
Hint
label=
{
error
}
ml=
{
1
}
color=
"text.error"
/>
}
<
Tooltip
content=
{
error
}
positioning=
{
{
placement
:
'
top
'
}
}
>
<
Box
cursor=
"pointer"
display=
"inherit"
onClick=
{
handleErrorHintIconClick
}
ml=
{
1
}
>
<
IconSvg
name=
"info"
boxSize=
{
5
}
color=
"text.error"
/>
</
Box
>
</
Tooltip
>
)
}
<
CloseButton
<
CloseButton
aria
-
label=
"Remove"
aria
-
label=
"Remove"
ml=
"auto"
ml=
{
2
}
onClick=
{
handleRemove
}
onClick=
{
handleRemove
}
disabled=
{
isDisabled
}
disabled=
{
isDisabled
}
alignSelf=
"flex-start"
/>
/>
</
Flex
>
</
Flex
>
<
Text
color=
"text.secondary"
mt=
{
1
}
>
<
Text
color=
"text.secondary"
textStyle=
"sm"
mt=
{
1
}
>
{
file
.
size
.
toLocaleString
(
undefined
,
{
notation
:
'
compact
'
,
maximumFractionDigits
:
2
,
unit
:
'
byte
'
,
unitDisplay
:
'
narrow
'
,
style
:
'
unit
'
})
}
{
file
.
size
.
toLocaleString
(
undefined
,
{
notation
:
'
compact
'
,
maximumFractionDigits
:
2
,
unit
:
'
byte
'
,
unitDisplay
:
'
narrow
'
,
style
:
'
unit
'
})
}
</
Text
>
</
Text
>
</
Box
>
</
Box
>
...
...
ui/shared/gas/GasInfoTooltip.tsx
View file @
2750d34d
...
@@ -42,9 +42,9 @@ const GasInfoTooltip = ({ children, data, dataUpdatedAt, placement }: Props) =>
...
@@ -42,9 +42,9 @@ const GasInfoTooltip = ({ children, data, dataUpdatedAt, placement }: Props) =>
const
content
=
(
const
content
=
(
<
Flex
flexDir=
"column"
textStyle=
"xs"
rowGap=
{
3
}
>
<
Flex
flexDir=
"column"
textStyle=
"xs"
rowGap=
{
3
}
>
{
data
.
gas_price_updated_at
&&
(
{
data
.
gas_price_updated_at
&&
(
<
Flex
justifyContent=
"space-between"
>
<
Flex
justifyContent=
"space-between"
alignItems=
"center"
>
<
Box
color=
"text.secondary"
>
Last update
</
Box
>
<
Box
color=
"text.secondary"
>
Last update
</
Box
>
<
Flex
color=
"text.secondary"
justifyContent=
"flex-end"
columnGap=
{
2
}
ml=
{
3
}
>
<
Flex
color=
"text.secondary"
justifyContent=
"flex-end"
alignItems=
"center"
columnGap=
{
2
}
ml=
{
3
}
>
{
dayjs
(
data
.
gas_price_updated_at
).
format
(
'
MMM DD, HH:mm:ss
'
)
}
{
dayjs
(
data
.
gas_price_updated_at
).
format
(
'
MMM DD, HH:mm:ss
'
)
}
{
data
.
gas_prices_update_in
!==
0
&&
{
data
.
gas_prices_update_in
!==
0
&&
<
GasInfoUpdateTimer
key=
{
dataUpdatedAt
}
startTime=
{
dataUpdatedAt
}
duration=
{
data
.
gas_prices_update_in
}
/>
}
<
GasInfoUpdateTimer
key=
{
dataUpdatedAt
}
startTime=
{
dataUpdatedAt
}
duration=
{
data
.
gas_prices_update_in
}
/>
}
...
...
ui/shared/pagination/Pagination.tsx
View file @
2750d34d
...
@@ -26,7 +26,7 @@ const Pagination = (props: Props) => {
...
@@ -26,7 +26,7 @@ const Pagination = (props: Props) => {
alignItems=
"center"
alignItems=
"center"
{
...
rest
}
{
...
rest
}
>
>
<
Skeleton
loading=
{
showSkeleton
}
mr=
{
4
}
>
<
Skeleton
loading=
{
showSkeleton
}
mr=
{
3
}
>
<
Button
<
Button
variant=
"outline"
variant=
"outline"
size=
"sm"
size=
"sm"
...
@@ -39,8 +39,7 @@ const Pagination = (props: Props) => {
...
@@ -39,8 +39,7 @@ const Pagination = (props: Props) => {
<
IconButton
<
IconButton
aria
-
label=
"Prev page"
aria
-
label=
"Prev page"
variant=
"outline"
variant=
"outline"
w=
{
9
}
boxSize=
{
8
}
h=
{
8
}
onClick=
{
onPrevPageClick
}
onClick=
{
onPrevPageClick
}
disabled=
{
!
canGoBackwards
||
isLoading
||
page
===
1
}
disabled=
{
!
canGoBackwards
||
isLoading
||
page
===
1
}
loadingSkeleton=
{
showSkeleton
}
loadingSkeleton=
{
showSkeleton
}
...
@@ -53,11 +52,11 @@ const Pagination = (props: Props) => {
...
@@ -53,11 +52,11 @@ const Pagination = (props: Props) => {
alignItems=
"center"
alignItems=
"center"
justifyContent=
"center"
justifyContent=
"center"
h=
{
8
}
h=
{
8
}
minW=
{
9
}
minW=
{
8
}
px=
{
2
}
px=
{
2
}
fontWeight=
"semibold"
bgColor=
{
{
_light
:
'
blue.50
'
,
_dark
:
'
whiteAlpha.100
'
}
}
bgColor=
{
{
_light
:
'
blue.50
'
,
_dark
:
'
whiteAlpha.100
'
}
}
color=
{
{
_light
:
'
bl
ackAlpha.8
00
'
,
_dark
:
'
gray.50
'
}
}
color=
{
{
_light
:
'
bl
ue.7
00
'
,
_dark
:
'
gray.50
'
}
}
borderRadius=
"base"
borderRadius=
"base"
textStyle=
"sm"
textStyle=
"sm"
>
>
...
@@ -67,8 +66,7 @@ const Pagination = (props: Props) => {
...
@@ -67,8 +66,7 @@ const Pagination = (props: Props) => {
<
IconButton
<
IconButton
aria
-
label=
"Next page"
aria
-
label=
"Next page"
variant=
"outline"
variant=
"outline"
w=
{
9
}
boxSize=
{
8
}
h=
{
8
}
onClick=
{
onNextPageClick
}
onClick=
{
onNextPageClick
}
disabled=
{
!
hasNextPage
||
isLoading
}
disabled=
{
!
hasNextPage
||
isLoading
}
loadingSkeleton=
{
showSkeleton
}
loadingSkeleton=
{
showSkeleton
}
...
...
ui/showcases/Dialog.tsx
View file @
2750d34d
/* eslint-disable max-len */
/* eslint-disable max-len */
import
{
noop
}
from
'
es-toolkit
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Button
}
from
'
toolkit/chakra/button
'
;
import
{
Button
}
from
'
toolkit/chakra/button
'
;
...
@@ -30,14 +31,15 @@ const DialogShowcase = () => {
...
@@ -30,14 +31,15 @@ const DialogShowcase = () => {
<
p
>
{
CONTENT
}
</
p
>
<
p
>
{
CONTENT
}
</
p
>
</
DialogBody
>
</
DialogBody
>
<
DialogFooter
>
<
DialogFooter
>
<
Button
>
Save
</
Button
>
<
DialogActionTrigger
asChild
>
<
DialogActionTrigger
asChild
>
<
Button
variant=
"
outline"
>
Cancel
</
Button
>
<
Button
variant=
"
link"
>
I'll do it later
</
Button
>
</
DialogActionTrigger
>
</
DialogActionTrigger
>
<
Button
>
Save
</
Button
>
</
DialogFooter
>
</
DialogFooter
>
</
DialogContent
>
</
DialogContent
>
</
DialogRoot
>
</
DialogRoot
>
</
Sample
>
</
Sample
>
<
Sample
label=
"size: md"
>
<
Sample
label=
"size: md"
>
<
DialogRoot
size=
"md"
>
<
DialogRoot
size=
"md"
>
<
DialogTrigger
asChild
>
<
DialogTrigger
asChild
>
...
@@ -46,7 +48,7 @@ const DialogShowcase = () => {
...
@@ -46,7 +48,7 @@ const DialogShowcase = () => {
</
Button
>
</
Button
>
</
DialogTrigger
>
</
DialogTrigger
>
<
DialogContent
>
<
DialogContent
>
<
DialogHeader
>
<
DialogHeader
onBackToClick=
{
noop
}
>
<
DialogTitle
>
Dialog Title
</
DialogTitle
>
<
DialogTitle
>
Dialog Title
</
DialogTitle
>
</
DialogHeader
>
</
DialogHeader
>
<
DialogBody
>
<
DialogBody
>
...
@@ -61,6 +63,7 @@ const DialogShowcase = () => {
...
@@ -61,6 +63,7 @@ const DialogShowcase = () => {
</
DialogContent
>
</
DialogContent
>
</
DialogRoot
>
</
DialogRoot
>
</
Sample
>
</
Sample
>
<
Sample
label=
"size: full"
>
<
Sample
label=
"size: full"
>
<
DialogRoot
size=
"full"
>
<
DialogRoot
size=
"full"
>
<
DialogTrigger
asChild
>
<
DialogTrigger
asChild
>
...
...
ui/showcases/ProgressCircle.tsx
View file @
2750d34d
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
ProgressCircleRoot
,
ProgressCircleRing
}
from
'
toolkit/chakra/progress-circle
'
;
import
{
ProgressCircleRoot
,
ProgressCircleRing
,
ProgressCircleValueText
}
from
'
toolkit/chakra/progress-circle
'
;
import
{
Section
,
Container
,
SectionHeader
,
SamplesStack
,
Sample
}
from
'
./parts
'
;
import
{
Section
,
Container
,
SectionHeader
,
SamplesStack
,
Sample
}
from
'
./parts
'
;
...
@@ -25,7 +25,7 @@ const ProgressCircleShowcase = () => {
...
@@ -25,7 +25,7 @@ const ProgressCircleShowcase = () => {
<
Section
>
<
Section
>
<
SectionHeader
>
Size
</
SectionHeader
>
<
SectionHeader
>
Size
</
SectionHeader
>
<
SamplesStack
>
<
SamplesStack
>
{
([
'
sm
'
,
'
md
'
]
as
const
).
map
((
size
)
=>
(
{
([
'
sm
'
,
'
md
'
,
'
lg
'
]
as
const
).
map
((
size
)
=>
(
<
Sample
key=
{
size
}
label=
{
`size: ${ size }`
}
>
<
Sample
key=
{
size
}
label=
{
`size: ${ size }`
}
>
<
ProgressCircleRoot
<
ProgressCircleRoot
value=
{
45
}
value=
{
45
}
...
@@ -33,6 +33,7 @@ const ProgressCircleShowcase = () => {
...
@@ -33,6 +33,7 @@ const ProgressCircleShowcase = () => {
size=
{
size
}
size=
{
size
}
>
>
<
ProgressCircleRing
/>
<
ProgressCircleRing
/>
{
size
===
'
lg
'
&&
<
ProgressCircleValueText
/>
}
</
ProgressCircleRoot
>
</
ProgressCircleRoot
>
</
Sample
>
</
Sample
>
))
}
))
}
...
...
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