Fix copy button

This commit is contained in:
Robert Long 2021-12-13 15:49:12 -08:00
parent 2466f25d9f
commit 4d6c4bc70e
4 changed files with 11 additions and 4 deletions

View file

@ -314,6 +314,7 @@ function RoomSetupView({
<CopyButton
value={window.location.href}
className={styles.copyButton}
copiedMessage="Call link copied"
>
Copy call link and join later
</CopyButton>

View file

@ -108,7 +108,7 @@ limitations under the License.
}
.copyButton {
width: auto !important;
width: 320px !important;
}
.previewButtons > * {

View file

@ -138,7 +138,6 @@ limitations under the License.
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
}
.copyButton svg {

View file

@ -4,7 +4,14 @@ import { ReactComponent as CheckIcon } from "../icons/Check.svg";
import { ReactComponent as CopyIcon } from "../icons/Copy.svg";
import { Button } from "./Button";
export function CopyButton({ value, children, onClassName, variant, ...rest }) {
export function CopyButton({
value,
children,
onClassName,
variant,
copiedMessage,
...rest
}) {
const [isCopied, setCopied] = useClipboard(value, { successDuration: 3000 });
return (
@ -18,7 +25,7 @@ export function CopyButton({ value, children, onClassName, variant, ...rest }) {
>
{isCopied ? (
<>
{variant !== "icon" && <span>Copied!</span>}
{variant !== "icon" && <span>{copiedMessage || "Copied!"}</span>}
<CheckIcon />
</>
) : (