From 07cd343b104728f0282006c4f49c48b214937636 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Mon, 5 Sep 2022 17:52:18 -0500 Subject: [PATCH] feat: add button to copy current URL --- src/components/Shell/Shell.tsx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/components/Shell/Shell.tsx b/src/components/Shell/Shell.tsx index 5cb5750..4e90c67 100644 --- a/src/components/Shell/Shell.tsx +++ b/src/components/Shell/Shell.tsx @@ -33,6 +33,7 @@ import ListItemText from '@mui/material/ListItemText' import Home from '@mui/icons-material/Home' import Brightness4Icon from '@mui/icons-material/Brightness4' import Brightness7Icon from '@mui/icons-material/Brightness7' +import LinkIcon from '@mui/icons-material/Link' import { ShellContext } from 'contexts/ShellContext' import { SettingsContext } from 'contexts/SettingsContext' @@ -168,6 +169,14 @@ export const Shell = ({ children, userPeerId }: ShellProps) => { setIsDrawerOpen(false) } + const handleLinkButtonClick = async () => { + await navigator.clipboard.writeText(window.location.href) + + shellContextValue.showAlert('Current URL copied to clipboard', { + severity: 'success', + }) + } + return ( @@ -220,9 +229,21 @@ export const Shell = ({ children, userPeerId }: ShellProps) => { > {title} + + + + + {doShowPeers ? ( - + ) : null}