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
441f62af
Unverified
Commit
441f62af
authored
Dec 09, 2022
by
tom goriunov
Committed by
GitHub
Dec 09, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #422 from blockscout/packages-update
packages update
parents
d5694453
e8059908
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
763 additions
and
687 deletions
+763
-687
useCurrentRoute.ts
lib/link/useCurrentRoute.ts
+6
-1
package.json
package.json
+9
-9
Form.ts
theme/components/Form.ts
+7
-7
FormLabel.ts
theme/components/FormLabel.ts
+2
-2
Popover.ts
theme/components/Popover.ts
+4
-0
getDefaultFormColors.ts
theme/utils/getDefaultFormColors.ts
+2
-1
getOutlinedFieldStyles.ts
theme/utils/getOutlinedFieldStyles.ts
+3
-3
ApiKeyForm.tsx
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
+1
-3
PublicTagFormComment.tsx
ui/publicTags/PublicTagsForm/PublicTagFormComment.tsx
+2
-4
yarn.lock
yarn.lock
+727
-657
No files found.
lib/link/useCurrentRoute.ts
View file @
441f62af
...
@@ -4,13 +4,18 @@ import React from 'react';
...
@@ -4,13 +4,18 @@ import React from 'react';
import
type
{
RouteName
}
from
'
lib/link/routes
'
;
import
type
{
RouteName
}
from
'
lib/link/routes
'
;
import
{
ROUTES
}
from
'
lib/link/routes
'
;
import
{
ROUTES
}
from
'
lib/link/routes
'
;
const
PATH_PARAM_REGEXP
=
/
\/
:
(\w
+
)
/g
;
export
default
function
useCurrentRoute
()
{
export
default
function
useCurrentRoute
()
{
const
{
route
:
nextRoute
}
=
useRouter
();
const
{
route
:
nextRoute
}
=
useRouter
();
return
React
.
useCallback
(():
RouteName
=>
{
return
React
.
useCallback
(():
RouteName
=>
{
for
(
const
routeName
in
ROUTES
)
{
for
(
const
routeName
in
ROUTES
)
{
const
route
=
ROUTES
[
routeName
as
RouteName
];
const
route
=
ROUTES
[
routeName
as
RouteName
];
if
(
route
.
pattern
===
nextRoute
)
{
const
formattedRoute
=
route
.
pattern
.
replace
(
PATH_PARAM_REGEXP
,
(
_
,
paramName
:
string
)
=>
{
return
`/[
${
paramName
}
]`
;
});
if
(
formattedRoute
===
nextRoute
)
{
return
routeName
as
RouteName
;
return
routeName
as
RouteName
;
}
}
}
}
...
...
package.json
View file @
441f62af
...
@@ -27,13 +27,13 @@
...
@@ -27,13 +27,13 @@
"test:jest:watch"
:
"jest --watch"
"test:jest:watch"
:
"jest --watch"
},
},
"dependencies"
:
{
"dependencies"
:
{
"
@chakra-ui/react
"
:
"
2.
3.1
"
,
"
@chakra-ui/react
"
:
"
2.
4.3
"
,
"
@chakra-ui/theme-tools
"
:
"
^2.0.
2
"
,
"
@chakra-ui/theme-tools
"
:
"
^2.0.
14
"
,
"
@emotion/react
"
:
"
^11
"
,
"
@emotion/react
"
:
"
^11
.10.4
"
,
"
@emotion/styled
"
:
"
^11
"
,
"
@emotion/styled
"
:
"
^11
.10.4
"
,
"
@sentry/nextjs
"
:
"
^7.12.1
"
,
"
@sentry/nextjs
"
:
"
^7.12.1
"
,
"
@sentry/react
"
:
"
^7.
13
.0
"
,
"
@sentry/react
"
:
"
^7.
24
.0
"
,
"
@sentry/tracing
"
:
"
^7.
13
.0
"
,
"
@sentry/tracing
"
:
"
^7.
24
.0
"
,
"
@tanstack/react-query
"
:
"
^4.0.10
"
,
"
@tanstack/react-query
"
:
"
^4.0.10
"
,
"
@tanstack/react-query-devtools
"
:
"
^4.0.10
"
,
"
@tanstack/react-query-devtools
"
:
"
^4.0.10
"
,
"
@types/react-scroll
"
:
"
^1.8.4
"
,
"
@types/react-scroll
"
:
"
^1.8.4
"
,
...
@@ -41,15 +41,15 @@
...
@@ -41,15 +41,15 @@
"
d3
"
:
"
^7.6.1
"
,
"
d3
"
:
"
^7.6.1
"
,
"
dayjs
"
:
"
^1.11.5
"
,
"
dayjs
"
:
"
^1.11.5
"
,
"
ethers
"
:
"
^5.7.1
"
,
"
ethers
"
:
"
^5.7.1
"
,
"
framer-motion
"
:
"
^6
"
,
"
framer-motion
"
:
"
^6
.5.1
"
,
"
lodash
"
:
"
^4.0.0
"
,
"
lodash
"
:
"
^4.0.0
"
,
"
next
"
:
"
12.2.5
"
,
"
next
"
:
"
12.2.5
"
,
"
node-fetch
"
:
"
^3.2.9
"
,
"
node-fetch
"
:
"
^3.2.9
"
,
"
phoenix
"
:
"
^1.6.15
"
,
"
phoenix
"
:
"
^1.6.15
"
,
"
pino-http
"
:
"
^8.2.1
"
,
"
pino-http
"
:
"
^8.2.1
"
,
"
pino-pretty
"
:
"
^9.1.1
"
,
"
pino-pretty
"
:
"
^9.1.1
"
,
"
react
"
:
"
18.
1
.0
"
,
"
react
"
:
"
18.
2
.0
"
,
"
react-dom
"
:
"
18.
1
.0
"
,
"
react-dom
"
:
"
18.
2
.0
"
,
"
react-hook-form
"
:
"
^7.33.1
"
,
"
react-hook-form
"
:
"
^7.33.1
"
,
"
react-identicons
"
:
"
^1.2.5
"
,
"
react-identicons
"
:
"
^1.2.5
"
,
"
react-jazzicon
"
:
"
^1.0.4
"
,
"
react-jazzicon
"
:
"
^1.0.4
"
,
...
...
theme/components/Form.ts
View file @
441f62af
import
{
formAnatomy
as
parts
}
from
'
@chakra-ui/anatomy
'
;
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
type
{
StyleFunctionProps
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
,
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
}
from
'
@chakra-ui/theme-tools
'
;
import
getDefaultFormColors
from
'
../utils/getDefaultFormColors
'
;
import
getDefaultFormColors
from
'
../utils/getDefaultFormColors
'
;
import
FormLabel
from
'
./FormLabel
'
;
import
FormLabel
from
'
./FormLabel
'
;
...
@@ -13,7 +13,7 @@ const { definePartsStyle, defineMultiStyleConfig } =
...
@@ -13,7 +13,7 @@ const { definePartsStyle, defineMultiStyleConfig } =
function
getFloatingVariantStylesForSize
(
size
:
'
md
'
|
'
lg
'
,
props
:
StyleFunctionProps
)
{
function
getFloatingVariantStylesForSize
(
size
:
'
md
'
|
'
lg
'
,
props
:
StyleFunctionProps
)
{
const
{
theme
}
=
props
;
const
{
theme
}
=
props
;
const
{
focus
Color
:
fc
,
errorColor
:
ec
}
=
getDefaultFormColors
(
props
);
const
{
focus
PlaceholderColor
,
errorColor
}
=
getDefaultFormColors
(
props
);
const
activeLabelStyles
=
{
const
activeLabelStyles
=
{
...
FormLabel
.
variants
?.
floating
?.(
props
).
_focusWithin
,
...
FormLabel
.
variants
?.
floating
?.(
props
).
_focusWithin
,
...
@@ -62,7 +62,7 @@ function getFloatingVariantStylesForSize(size: 'md' | 'lg', props: StyleFunction
...
@@ -62,7 +62,7 @@ function getFloatingVariantStylesForSize(size: 'md' | 'lg', props: StyleFunction
label
:
FormLabel
.
sizes
?.[
size
](
props
)
||
{},
label
:
FormLabel
.
sizes
?.[
size
](
props
)
||
{},
'
input:not(:placeholder-shown) + label, textarea:not(:placeholder-shown) + label
'
:
activeLabelStyles
,
'
input:not(:placeholder-shown) + label, textarea:not(:placeholder-shown) + label
'
:
activeLabelStyles
,
'
input[aria-invalid=true] + label, textarea[aria-invalid=true] + label
'
:
{
'
input[aria-invalid=true] + label, textarea[aria-invalid=true] + label
'
:
{
color
:
getColor
(
theme
,
e
c
),
color
:
getColor
(
theme
,
e
rrorColor
),
},
},
// input styles
// input styles
...
@@ -78,20 +78,20 @@ function getFloatingVariantStylesForSize(size: 'md' | 'lg', props: StyleFunction
...
@@ -78,20 +78,20 @@ function getFloatingVariantStylesForSize(size: 'md' | 'lg', props: StyleFunction
// indicator styles
// indicator styles
'
input:not(:placeholder-shown) + label .chakra-form__required-indicator, textarea:not(:placeholder-shown) + label .chakra-form__required-indicator
'
:
{
'
input:not(:placeholder-shown) + label .chakra-form__required-indicator, textarea:not(:placeholder-shown) + label .chakra-form__required-indicator
'
:
{
color
:
getColor
(
theme
,
f
c
),
color
:
getColor
(
theme
,
f
ocusPlaceholderColor
),
},
},
'
input[aria-invalid=true] + label .chakra-form__required-indicator, textarea[aria-invalid=true] + label .chakra-form__required-indicator
'
:
{
'
input[aria-invalid=true] + label .chakra-form__required-indicator, textarea[aria-invalid=true] + label .chakra-form__required-indicator
'
:
{
color
:
getColor
(
theme
,
e
c
),
color
:
getColor
(
theme
,
e
rrorColor
),
},
},
},
},
};
};
}
}
const
baseStyle
=
definePartsStyle
((
props
)
=>
{
const
baseStyle
=
definePartsStyle
(()
=>
{
return
{
return
{
requiredIndicator
:
{
requiredIndicator
:
{
marginStart
:
0
,
marginStart
:
0
,
color
:
mode
(
'
gray.500
'
,
'
whiteAlpha.400
'
)(
props
)
,
color
:
'
gray.500
'
,
},
},
};
};
});
});
...
...
theme/components/FormLabel.ts
View file @
441f62af
...
@@ -19,7 +19,7 @@ const baseStyle = defineStyle({
...
@@ -19,7 +19,7 @@ const baseStyle = defineStyle({
const
variantFloating
=
defineStyle
((
props
)
=>
{
const
variantFloating
=
defineStyle
((
props
)
=>
{
const
{
theme
,
backgroundColor
}
=
props
;
const
{
theme
,
backgroundColor
}
=
props
;
const
{
focus
Color
:
fc
}
=
getDefaultFormColors
(
props
);
const
{
focus
PlaceholderColor
}
=
getDefaultFormColors
(
props
);
const
bc
=
backgroundColor
||
mode
(
'
white
'
,
'
black
'
)(
props
);
const
bc
=
backgroundColor
||
mode
(
'
white
'
,
'
black
'
)(
props
);
return
{
return
{
...
@@ -40,7 +40,7 @@ const variantFloating = defineStyle((props) => {
...
@@ -40,7 +40,7 @@ const variantFloating = defineStyle((props) => {
textOverflow
:
'
ellipsis
'
,
textOverflow
:
'
ellipsis
'
,
_focusWithin
:
{
_focusWithin
:
{
backgroundColor
:
bc
,
backgroundColor
:
bc
,
color
:
getColor
(
theme
,
f
c
),
color
:
getColor
(
theme
,
f
ocusPlaceholderColor
),
fontSize
:
'
xs
'
,
fontSize
:
'
xs
'
,
lineHeight
:
'
16px
'
,
lineHeight
:
'
16px
'
,
borderTopRightRadius
:
'
none
'
,
borderTopRightRadius
:
'
none
'
,
...
...
theme/components/Popover.ts
View file @
441f62af
...
@@ -26,6 +26,10 @@ const baseStyleContent = defineStyle((props) => {
...
@@ -26,6 +26,10 @@ const baseStyleContent = defineStyle((props) => {
bg
:
$popperBg
.
reference
,
bg
:
$popperBg
.
reference
,
[
$arrowBg
.
variable
]:
$popperBg
.
reference
,
[
$arrowBg
.
variable
]:
$popperBg
.
reference
,
[
$arrowShadowColor
.
variable
]:
`colors.
${
shadowColor
}
`
,
[
$arrowShadowColor
.
variable
]:
`colors.
${
shadowColor
}
`
,
_dark
:
{
[
$popperBg
.
variable
]:
`colors.gray.900`
,
[
$arrowShadowColor
.
variable
]:
`colors.whiteAlpha.300`
,
},
width
:
'
xs
'
,
width
:
'
xs
'
,
border
:
'
none
'
,
border
:
'
none
'
,
borderColor
:
'
inherit
'
,
borderColor
:
'
inherit
'
,
...
...
theme/utils/getDefaultFormColors.ts
View file @
441f62af
...
@@ -4,7 +4,8 @@ import { mode } from '@chakra-ui/theme-tools';
...
@@ -4,7 +4,8 @@ import { mode } from '@chakra-ui/theme-tools';
export
default
function
getDefaultFormColors
(
props
:
StyleFunctionProps
)
{
export
default
function
getDefaultFormColors
(
props
:
StyleFunctionProps
)
{
const
{
focusBorderColor
:
fc
,
errorBorderColor
:
ec
,
filledBorderColor
:
flc
}
=
props
;
const
{
focusBorderColor
:
fc
,
errorBorderColor
:
ec
,
filledBorderColor
:
flc
}
=
props
;
return
{
return
{
focusColor
:
fc
||
mode
(
'
brand.700
'
,
'
brand.300
'
)(
props
),
focusBorderColor
:
fc
||
mode
(
'
blue.500
'
,
'
blue.300
'
)(
props
),
focusPlaceholderColor
:
fc
||
'
gray.500
'
,
errorColor
:
ec
||
mode
(
'
red.400
'
,
'
red.300
'
)(
props
),
errorColor
:
ec
||
mode
(
'
red.400
'
,
'
red.300
'
)(
props
),
filledColor
:
flc
||
mode
(
'
gray.300
'
,
'
gray.600
'
)(
props
),
filledColor
:
flc
||
mode
(
'
gray.300
'
,
'
gray.600
'
)(
props
),
};
};
...
...
theme/utils/getOutlinedFieldStyles.ts
View file @
441f62af
...
@@ -6,7 +6,7 @@ import getDefaultTransitionProps from './getDefaultTransitionProps';
...
@@ -6,7 +6,7 @@ import getDefaultTransitionProps from './getDefaultTransitionProps';
export
default
function
getOutlinedFieldStyles
(
props
:
StyleFunctionProps
)
{
export
default
function
getOutlinedFieldStyles
(
props
:
StyleFunctionProps
)
{
const
{
theme
,
borderColor
}
=
props
;
const
{
theme
,
borderColor
}
=
props
;
const
{
focus
Color
:
fc
,
errorColor
:
ec
}
=
getDefaultFormColors
(
props
);
const
{
focus
BorderColor
,
errorColor
}
=
getDefaultFormColors
(
props
);
const
transitionProps
=
getDefaultTransitionProps
();
const
transitionProps
=
getDefaultTransitionProps
();
return
{
return
{
...
@@ -32,12 +32,12 @@ export default function getOutlinedFieldStyles(props: StyleFunctionProps) {
...
@@ -32,12 +32,12 @@ export default function getOutlinedFieldStyles(props: StyleFunctionProps) {
},
},
},
},
_invalid
:
{
_invalid
:
{
borderColor
:
getColor
(
theme
,
e
c
),
borderColor
:
getColor
(
theme
,
e
rrorColor
),
boxShadow
:
`none`
,
boxShadow
:
`none`
,
},
},
_focusVisible
:
{
_focusVisible
:
{
zIndex
:
1
,
zIndex
:
1
,
borderColor
:
getColor
(
theme
,
f
c
),
borderColor
:
getColor
(
theme
,
f
ocusBorderColor
),
boxShadow
:
'
md
'
,
boxShadow
:
'
md
'
,
},
},
_placeholder
:
{
_placeholder
:
{
...
...
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
View file @
441f62af
...
@@ -112,9 +112,7 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
...
@@ -112,9 +112,7 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
isInvalid=
{
Boolean
(
errors
.
name
)
}
isInvalid=
{
Boolean
(
errors
.
name
)
}
maxLength=
{
NAME_MAX_LENGTH
}
maxLength=
{
NAME_MAX_LENGTH
}
/>
/>
<
FormLabel
>
<
InputPlaceholder
text=
"Application name for API key (e.g Web3 project)"
error=
{
errors
.
name
}
/>
<
InputPlaceholder
text=
"Application name for API key (e.g Web3 project)"
error=
{
errors
.
name
}
/>
</
FormLabel
>
</
FormControl
>
</
FormControl
>
);
);
},
[
errors
,
formBackgroundColor
]);
},
[
errors
,
formBackgroundColor
]);
...
...
ui/publicTags/PublicTagsForm/PublicTagFormComment.tsx
View file @
441f62af
import
type
{
InputProps
}
from
'
@chakra-ui/react
'
;
import
type
{
InputProps
}
from
'
@chakra-ui/react
'
;
import
{
FormControl
,
FormLabel
,
Textarea
}
from
'
@chakra-ui/react
'
;
import
{
FormControl
,
Textarea
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
ControllerRenderProps
,
Control
,
FieldError
}
from
'
react-hook-form
'
;
import
type
{
ControllerRenderProps
,
Control
,
FieldError
}
from
'
react-hook-form
'
;
import
{
Controller
}
from
'
react-hook-form
'
;
import
{
Controller
}
from
'
react-hook-form
'
;
...
@@ -24,9 +24,7 @@ export default function PublicTagFormComment({ control, error, size }: Props) {
...
@@ -24,9 +24,7 @@ export default function PublicTagFormComment({ control, error, size }: Props) {
{
...
field
}
{
...
field
}
isInvalid=
{
Boolean
(
error
)
}
isInvalid=
{
Boolean
(
error
)
}
/>
/>
<
FormLabel
>
<
InputPlaceholder
text=
"Specify the reason for adding tags and color preference(s)"
error=
{
error
}
/>
<
InputPlaceholder
text=
"Specify the reason for adding tags and color preference(s)"
error=
{
error
}
/>
</
FormLabel
>
</
FormControl
>
</
FormControl
>
);
);
},
[
error
,
size
]);
},
[
error
,
size
]);
...
...
yarn.lock
View file @
441f62af
This diff is collapsed.
Click to expand it.
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