-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add copy to clipboard button next to dbKey (#121)
- Loading branch information
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
app/components/Layout/components/Detail/components/Section/section.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { GridPaperSection as DXGridPaperSection } from "@databiosphere/findable-ui/lib/components/common/Section/section.styles"; | ||
import styled from "@emotion/styled"; | ||
|
||
export const GridPaperSection = styled(DXGridPaperSection)` | ||
min-width: 0; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { CopyToClipboard } from "@databiosphere/findable-ui/lib/components/common/CopyToClipboard/copyToClipboard"; | ||
import { Grid2, Grid2Props, Typography } from "@mui/material"; | ||
import { ReactNode } from "react"; | ||
|
||
export interface CopyTextProps { | ||
children: ReactNode; | ||
gridProps?: Partial<Grid2Props>; | ||
text: string; | ||
} | ||
|
||
export const CopyText = ({ | ||
children, | ||
gridProps, | ||
text, | ||
}: CopyTextProps): JSX.Element => { | ||
return ( | ||
<Grid2 container columnSpacing={1} wrap="nowrap" {...gridProps}> | ||
<Typography component="span" noWrap> | ||
{children} | ||
</Typography> | ||
<CopyToClipboard copyStr={text} /> | ||
</Grid2> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters