@material-ui/icons#FileCopyOutlined TypeScript Examples
The following examples show how to use
@material-ui/icons#FileCopyOutlined.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CopyButton.tsx From homebase-app with MIT License | 5 votes |
CopyIcon = styled(FileCopyOutlined)({
cursor: "pointer",
})
Example #2
Source File: CopyButton.tsx From homebase-app with MIT License | 5 votes |
CopyIcon = styled(FileCopyOutlined)({
cursor: "pointer"
})
Example #3
Source File: UserMenuSheet.tsx From homebase-app with MIT License | 5 votes |
UserMenuSheet: React.FC<Props> = (props) => {
const { account, reset, connect } = useTezos();
const handleAccountClick = () => {
if(account) {
navigator.clipboard.writeText(account)
} else {
connect()
}
props.onClose()
}
const handleLogout = () => {
reset()
props.onClose()
}
return (
<BottomSheet open={props.open} onDismiss={props.onClose}>
<SheetContainer>
<SheetItem>
<Grid
container
justifyContent="center"
style={{ gap: 9 }}
alignItems="center"
onClick={handleAccountClick}
>
{account ? (
<>
<Grid item>
<Blockie address={account} size={24} />
</Grid>
<Grid item>
<MenuText color="textPrimary">
{toShortAddress(account)}
</MenuText>
</Grid>
<Grid item>
<FileCopyOutlined htmlColor="#FFF" fontSize="small" />
</Grid>
</>
) : (
<>
<Grid item>
<ArrowDownwardOutlined htmlColor="#FFF" fontSize="small" />
</Grid>
<Grid item>
<MenuText color="textPrimary">Connect Wallet</MenuText>
</Grid>
</>
)}
</Grid>
</SheetItem>
<SheetItem>
<Grid
container
justifyContent="center"
style={{ gap: 9 }}
alignItems="center"
onClick={handleLogout}
>
<Grid item>
<ExitToApp htmlColor="#FFF" fontSize="small" />
</Grid>
<Grid item>
<MenuText color="textPrimary">Log Out</MenuText>
</Grid>
</Grid>
</SheetItem>
</SheetContainer>
</BottomSheet>
);
}
Example #4
Source File: Toolbar.tsx From homebase-app with MIT License | 4 votes |
Navbar: React.FC<{ mode: "creator" | "explorer", disableMobileMenu?: boolean }> = ({
mode,
children,
disableMobileMenu
}) => {
const { connect, account, reset, changeNetwork, network } = useTezos();
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(
null
);
const [popperOpen, setPopperOpen] = useState(false);
const theme = useTheme();
const isMobileExtraSmall = useMediaQuery(theme.breakpoints.down("xs"));
const isMobileSmall = useMediaQuery(theme.breakpoints.down("sm"));
const [networkAnchorEl, setNetworkAnchorEl] =
React.useState<HTMLButtonElement | null>(null);
const [networkPopperOpen, setNetworkPopperOpen] = useState(false);
const handleNetworkClick = (event: React.MouseEvent<any>) => {
setNetworkAnchorEl(event.currentTarget);
setNetworkPopperOpen(!networkPopperOpen);
};
const handleNetworkChange = (network: Network) => {
changeNetwork(network);
setPopperOpen(!popperOpen);
setNetworkPopperOpen(!networkPopperOpen);
history.push("/explorer");
};
const handleClick = (event: React.MouseEvent<any>) => {
setAnchorEl(event.currentTarget);
setPopperOpen(!popperOpen);
};
const handleLogout = () => {
reset();
setPopperOpen(false);
};
const handleCopy = (address: string) => {
navigator.clipboard.writeText(address);
setPopperOpen(false);
};
const history = useHistory();
return (
<StyledAppBar>
<StyledToolbar>
<Header
container
direction={isMobileExtraSmall ? "column" : "row"}
alignItems="center"
wrap="wrap"
>
{mode === "explorer" && (
<Grid item>
<Box onClick={() => history.push("/explorer")}>
<ToolbarContainer container alignItems="center" wrap="nowrap">
<Grid item>
<LogoItem src={HomeButton} />
</Grid>
<Grid item>
<Box paddingLeft="10px">
<LogoText color="textSecondary">Homebase</LogoText>
</Box>
</Grid>
</ToolbarContainer>
</Box>
</Grid>
)}
<Grid item>
<Grid
container
justify={isMobileExtraSmall ? "center" : "flex-end"}
>
{account ? (
<>
<Grid
container
alignItems="center"
justify={isMobileExtraSmall ? "center" : "flex-end"}
>
{children}
<AddressBarWrapper item>
<AddressContainer
container
alignItems="center"
wrap="nowrap"
justify="flex-end"
onClick={handleClick}
style={{ gap: 8 }}
>
<Grid item>
<ProfileAvatar size={22} address={account} />
</Grid>
<Grid item>
<Typography>
<UserProfileName address={account} short={true} />
</Typography>
</Grid>
</AddressContainer>
</AddressBarWrapper>
</Grid>
<StyledPopover
id={"wallet-Popper"}
open={popperOpen}
anchorEl={anchorEl}
style={{ zIndex: 1500, borderRadius: 4 }}
onClose={() => {
setPopperOpen(false);
}}
PaperProps={{
style: {
borderRadius: 4,
backgroundColor: "transparent",
},
}}
>
<AddressMenu>
<AddressMenuItem
container
alignItems="center"
onClick={() => handleCopy(account)}
>
<AddressMenuIcon item>
<FileCopyOutlined
color="inherit"
fontSize="inherit"
/>
</AddressMenuIcon>
<Grid item>
<Typography variant="subtitle2" color="textSecondary">
{toShortAddress(account)}
</Typography>
</Grid>
</AddressMenuItem>
<AddressMenuItem
container
alignItems="center"
onClick={handleNetworkClick}
>
<Grid item>
<Typography variant="subtitle2" color="textSecondary">
Change network ({network})
</Typography>
</Grid>
</AddressMenuItem>
<AddressMenuItem
style={{
borderTop: "2px solid rgba(255, 255, 255, 0.2)",
}}
container
alignItems="center"
onClick={handleLogout}
>
<AddressMenuIcon item>
<ExitToAppOutlined
color="inherit"
fontSize="inherit"
/>
</AddressMenuIcon>
<Grid item>
<Typography variant="subtitle2" color="textSecondary">
Log out
</Typography>
</Grid>
</AddressMenuItem>
</AddressMenu>
</StyledPopover>
</>
) : !isMobileSmall ? (
<Grid container justify="flex-end" wrap="nowrap" style={{ gap: 8 }}>
<Grid item>
<ChangeNetworkButton />
</Grid>
<Grid item>
<ConnectWalletButton connect={() => connect()} />
</Grid>
</Grid>
) : (
<Grid container>
<Grid item>
<ViewButton variant="outlined" onClick={() => connect()}>
CONNECT
</ViewButton>
</Grid>
</Grid>
)}
</Grid>
</Grid>
</Header>
<NavigationMenu disableMobileMenu={disableMobileMenu}/>
</StyledToolbar>
<NetworkMenu
open={networkPopperOpen}
anchorEl={networkAnchorEl}
onClose={() => {
setNetworkPopperOpen(false);
}}
handleNetworkChange={handleNetworkChange}
/>
</StyledAppBar>
);
}