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
d57a835d
Commit
d57a835d
authored
Jan 03, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new color for copy to clipboard icon
parent
9e92c0da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
CopyToClipboard.tsx
ui/shared/CopyToClipboard.tsx
+3
-2
No files found.
ui/shared/CopyToClipboard.tsx
View file @
d57a835d
import
{
IconButton
,
Tooltip
,
useClipboard
,
chakra
,
useDisclosure
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
IconButton
,
Tooltip
,
useClipboard
,
chakra
,
useDisclosure
,
Skeleton
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -14,6 +14,7 @@ const CopyToClipboard = ({ text, className, isLoading }: Props) => {
...
@@ -14,6 +14,7 @@ const CopyToClipboard = ({ text, className, isLoading }: Props) => {
const
[
copied
,
setCopied
]
=
useState
(
false
);
const
[
copied
,
setCopied
]
=
useState
(
false
);
// have to implement controlled tooltip because of the issue - https://github.com/chakra-ui/chakra-ui/issues/7107
// have to implement controlled tooltip because of the issue - https://github.com/chakra-ui/chakra-ui/issues/7107
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
iconColor
=
useColorModeValue
(
'
gray.400
'
,
'
gray.500
'
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
hasCopied
)
{
if
(
hasCopied
)
{
...
@@ -34,7 +35,7 @@ const CopyToClipboard = ({ text, className, isLoading }: Props) => {
...
@@ -34,7 +35,7 @@ const CopyToClipboard = ({ text, className, isLoading }: Props) => {
icon=
{
<
IconSvg
name=
"copy"
boxSize=
{
5
}
/>
}
icon=
{
<
IconSvg
name=
"copy"
boxSize=
{
5
}
/>
}
w=
"20px"
w=
"20px"
h=
"20px"
h=
"20px"
color=
"gray.400"
color=
{
iconColor
}
variant=
"simple"
variant=
"simple"
display=
"inline-block"
display=
"inline-block"
flexShrink=
{
0
}
flexShrink=
{
0
}
...
...
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