Skip to content

Commit

Permalink
ensure the link for the copy action is functioning while viewing a co…
Browse files Browse the repository at this point in the history
…ncept
  • Loading branch information
lucyjemutai committed Sep 5, 2024
1 parent 5bfea97 commit 4f59e4c
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions pages/orgs/[org]/sources/[source]/concepts/[concept]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ function ConceptDetail() {
const handleChangePage = (event, newPage) => {
setPage(newPage);
};

const [isClicked, setIsClicked] = useState(false);
const handleCopyLinkClick = () => {
handleCopyLink(org, source, conceptDetail);
setIsClicked(true);
setTimeout(() => setIsClicked(false), 3000);
};
const handleChangeRowsPerPage = (event) => {
setRowsPerPage(parseInt(event.target.value, 10));
setPage(0);
Expand Down Expand Up @@ -189,13 +194,19 @@ function ConceptDetail() {
edge="end"
aria-label="copy link"
size="small"
onClick={() => {
handleCopyLink(org, source, conceptDetail);
}}
onClick={handleCopyLinkClick}
>
<ContentCopyIcon fontSize="small" />
</IconButton>
<Typography variant="body2" color="#FF5733" ml={1}>
<Typography
variant="body2"
ml={1}
onClick={handleCopyLinkClick}
style={{
cursor: "pointer",
color: isClicked ? "#4CAF50" : "#FF5733",
}}
>
Copy Link
</Typography>
</Box>
Expand Down

0 comments on commit 4f59e4c

Please sign in to comment.