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
8c349948
Commit
8c349948
authored
Feb 06, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix label bg color when disabled
parent
2d28c323
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
Form.ts
theme/components/Form.ts
+9
-2
ApiKeyForm.tsx
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
+1
-1
ApiKeyModal.tsx
ui/apiKey/ApiKeyModal/ApiKeyModal.tsx
+2
-2
InputPlaceholder.tsx
ui/shared/InputPlaceholder.tsx
+3
-1
No files found.
theme/components/Form.ts
View file @
8c349948
import
{
formAnatomy
as
parts
}
from
'
@chakra-ui/anatomy
'
;
import
{
createMultiStyleConfigHelpers
}
from
'
@chakra-ui/styled-system
'
;
import
type
{
StyleFunctionProps
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
,
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
getDefaultFormColors
from
'
../utils/getDefaultFormColors
'
;
import
FancySelect
from
'
./FancySelect
'
;
...
...
@@ -81,11 +81,18 @@ function getFloatingVariantStylesForSize(size: 'md' | 'lg', props: StyleFunction
'
input:not(:placeholder-shown), textarea:not(:placeholder-shown)
'
:
activeInputStyles
,
[
`
input[disabled] + label,
textarea[disabled] + label,
&[aria-disabled=true] label
`
]:
{
backgroundColor
:
'
transparent
'
,
},
// in textarea bg of label could not be transparent; it should match the background color of input but without alpha
// so we have to use non-standard colors here
'
textarea[disabled] + label
'
:
{
backgroundColor
:
mode
(
'
#ececec
'
,
'
#232425
'
)(
props
),
},
'
textarea[disabled] + label[data-in-modal=true]
'
:
{
backgroundColor
:
mode
(
'
#ececec
'
,
'
#292b34
'
)(
props
),
},
// indicator styles
'
input:not(:placeholder-shown) + label .chakra-form__required-indicator, textarea:not(:placeholder-shown) + label .chakra-form__required-indicator
'
:
{
...
...
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
View file @
8c349948
...
...
@@ -103,7 +103,7 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
{
...
field
}
disabled=
{
true
}
/>
<
FormLabel
>
Auto-generated API key token
</
FormLabel
>
<
FormLabel
data
-
in
-
modal=
"true"
>
Auto-generated API key token
</
FormLabel
>
</
FormControl
>
);
},
[]);
...
...
ui/apiKey/ApiKeyModal/ApiKeyModal.tsx
View file @
8c349948
...
...
@@ -12,7 +12,7 @@ type Props = {
data
?:
ApiKey
;
}
const
A
ddress
Modal
:
React
.
FC
<
Props
>
=
({
isOpen
,
onClose
,
data
})
=>
{
const
A
piKey
Modal
:
React
.
FC
<
Props
>
=
({
isOpen
,
onClose
,
data
})
=>
{
const
title
=
data
?
'
Edit API key
'
:
'
New API key
'
;
const
text
=
!
data
?
'
Add an application name to identify your API key. Click the button below to auto-generate the associated key.
'
:
''
;
...
...
@@ -34,4 +34,4 @@ const AddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
);
};
export default A
ddress
Modal;
export default A
piKey
Modal;
ui/shared/InputPlaceholder.tsx
View file @
8c349948
...
...
@@ -7,9 +7,10 @@ interface Props {
error
?:
Partial
<
FieldError
>
;
className
?:
string
;
isFancy
?:
boolean
;
isInModal
?:
boolean
;
}
const
InputPlaceholder
=
({
text
,
error
,
className
,
isFancy
}:
Props
)
=>
{
const
InputPlaceholder
=
({
text
,
error
,
className
,
isFancy
,
isInModal
}:
Props
)
=>
{
let
errorMessage
=
error
?.
message
;
if
(
!
errorMessage
&&
error
?.
type
===
'
pattern
'
)
{
...
...
@@ -20,6 +21,7 @@ const InputPlaceholder = ({ text, error, className, isFancy }: Props) => {
<
FormLabel
className=
{
className
}
{
...
(
isFancy
?
{
'
data
-
fancy
':
true
}
:
{})
}
{
...
(
isInModal
?
{
'
data
-
in
-
modal
':
true
}
:
{})
}
>
<
chakra
.
span
>
{
text
}
</
chakra
.
span
>
{
errorMessage
&&
<
chakra
.
span
order=
{
3
}
whiteSpace=
"pre"
>
-
{
errorMessage
}
</
chakra
.
span
>
}
...
...
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