Skip to content

Commit

Permalink
Merge pull request #139 from lucyjemutai/source
Browse files Browse the repository at this point in the history
Add the Source of the Related Concepts
  • Loading branch information
alaboso authored Sep 6, 2024
2 parents 103200c + 4f59e4c commit 4bbabba
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 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 Expand Up @@ -716,6 +727,9 @@ function ConceptDetail() {
<TableCell sx={{ textTransform: "uppercase" }}>
Concept
</TableCell>
<TableCell sx={{ textTransform: "uppercase" }}>
Source
</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down Expand Up @@ -755,6 +769,14 @@ function ConceptDetail() {
</details>
)}
</TableCell>
<TableCell>
<Link
href={`/orgs/${org}/sources/${source}`}
style={{ textDecoration: "none" }}
>
{source}
</Link>
</TableCell>
</TableRow>
);
})}
Expand Down

0 comments on commit 4bbabba

Please sign in to comment.