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
fb5726b7
Commit
fb5726b7
authored
Sep 25, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update input bg color and border radius
parent
29f3a72f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
CopyField.tsx
ui/rewards/CopyField.tsx
+25
-12
LoginStepContent.tsx
ui/rewards/steps/LoginStepContent.tsx
+1
-1
InputPlaceholder.tsx
ui/shared/InputPlaceholder.tsx
+4
-2
No files found.
ui/rewards/CopyField.tsx
View file @
fb5726b7
import
{
FormControl
,
Input
,
InputGroup
,
InputRightElement
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
FormControl
,
Input
,
InputGroup
,
InputRightElement
,
chakra
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
...
@@ -10,16 +10,29 @@ type Props = {
...
@@ -10,16 +10,29 @@ type Props = {
className
?:
string
;
className
?:
string
;
};
};
const
CopyField
=
({
label
,
value
,
className
}:
Props
)
=>
(
const
CopyField
=
({
label
,
value
,
className
}:
Props
)
=>
{
<
FormControl
variant=
"floating"
id=
{
label
}
className=
{
className
}
>
const
bgColor
=
`
${
useColorModeValue
(
'
gray.200
'
,
'
blackAlpha.900
'
)
}
!important`
;
<
InputGroup
>
return
(
<
Input
readOnly
fontWeight=
"500"
value=
{
value
}
overflow=
"hidden"
textOverflow=
"ellipsis"
pr=
"40px !important"
/>
<
FormControl
variant=
"floating"
id=
{
label
}
className=
{
className
}
>
<
InputPlaceholder
text=
{
label
}
/>
<
InputGroup
>
<
InputRightElement
w=
"40px"
display=
"flex"
justifyContent=
"flex-end"
pr=
{
2
}
>
<
Input
<
CopyToClipboard
text=
{
value
}
/>
readOnly
</
InputRightElement
>
fontWeight=
"500"
</
InputGroup
>
value=
{
value
}
</
FormControl
>
overflow=
"hidden"
);
textOverflow=
"ellipsis"
pr=
"40px !important"
bgColor=
{
bgColor
}
borderColor=
{
bgColor
}
borderRadius=
"12px !important"
/>
<
InputPlaceholder
text=
{
label
}
bgColor=
{
bgColor
}
/>
<
InputRightElement
w=
"40px"
display=
"flex"
justifyContent=
"flex-end"
pr=
{
2
}
>
<
CopyToClipboard
text=
{
value
}
/>
</
InputRightElement
>
</
InputGroup
>
</
FormControl
>
);
};
export
default
chakra
(
CopyField
);
export
default
chakra
(
CopyField
);
ui/rewards/steps/LoginStepContent.tsx
View file @
fb5726b7
...
@@ -34,7 +34,7 @@ const LoginStepContent = ({ goNext }: { goNext: () => void }) => {
...
@@ -34,7 +34,7 @@ const LoginStepContent = ({ goNext }: { goNext: () => void }) => {
</
Flex
>
</
Flex
>
{
isSwitchChecked
&&
(
{
isSwitchChecked
&&
(
<
FormControl
variant=
"floating"
id=
"referral-code"
mt=
{
3
}
>
<
FormControl
variant=
"floating"
id=
"referral-code"
mt=
{
3
}
>
<
Input
fontWeight=
"500"
/>
<
Input
fontWeight=
"500"
borderRadius=
"12px !important"
/>
<
InputPlaceholder
text=
"Code"
/>
<
InputPlaceholder
text=
"Code"
/>
</
FormControl
>
</
FormControl
>
)
}
)
}
...
...
ui/shared/InputPlaceholder.tsx
View file @
fb5726b7
...
@@ -7,9 +7,10 @@ interface Props {
...
@@ -7,9 +7,10 @@ interface Props {
icon
?:
React
.
ReactNode
;
icon
?:
React
.
ReactNode
;
error
?:
Partial
<
FieldError
>
;
error
?:
Partial
<
FieldError
>
;
isFancy
?:
boolean
;
isFancy
?:
boolean
;
className
?:
string
;
}
}
const
InputPlaceholder
=
({
text
,
icon
,
error
,
isFancy
}:
Props
)
=>
{
const
InputPlaceholder
=
({
text
,
icon
,
error
,
isFancy
,
className
}:
Props
)
=>
{
let
errorMessage
=
error
?.
message
;
let
errorMessage
=
error
?.
message
;
if
(
!
errorMessage
&&
error
?.
type
===
'
pattern
'
)
{
if
(
!
errorMessage
&&
error
?.
type
===
'
pattern
'
)
{
...
@@ -22,6 +23,7 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => {
...
@@ -22,6 +23,7 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => {
{
...
(
isFancy
?
{
'
data
-
fancy
':
true
}
:
{})
}
{
...
(
isFancy
?
{
'
data
-
fancy
':
true
}
:
{})
}
variant=
"floating"
variant=
"floating"
bgColor=
"deeppink"
bgColor=
"deeppink"
className=
{
className
}
>
>
{
icon
}
{
icon
}
<
chakra
.
span
>
{
text
}
</
chakra
.
span
>
<
chakra
.
span
>
{
text
}
</
chakra
.
span
>
...
@@ -30,4 +32,4 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => {
...
@@ -30,4 +32,4 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => {
);
);
};
};
export
default
React
.
memo
(
InputPlaceholder
);
export
default
React
.
memo
(
chakra
(
InputPlaceholder
)
);
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