mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-18 11:08:08 -04:00
feat(gui): open links in default browser (#50)
This commit is contained in:
parent
e4141c763b
commit
ff2e3ae8dd
10 changed files with 218 additions and 191 deletions
|
@ -1,6 +1,7 @@
|
|||
import { Box, CssBaseline, makeStyles } from "@material-ui/core";
|
||||
import { indigo } from "@material-ui/core/colors";
|
||||
import { createTheme, ThemeProvider } from "@material-ui/core/styles";
|
||||
import "@tauri-apps/plugin-shell";
|
||||
import { Route, MemoryRouter as Router, Routes } from "react-router-dom";
|
||||
import Navigation, { drawerWidth } from "./navigation/Navigation";
|
||||
import HelpPage from "./pages/help/HelpPage";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { IconButton } from "@material-ui/core";
|
||||
import { open } from "@tauri-apps/plugin-shell";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
export default function LinkIconButton({
|
||||
|
@ -9,7 +10,7 @@ export default function LinkIconButton({
|
|||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<IconButton component="span" onClick={() => window.open(url, "_blank")}>
|
||||
<IconButton component="span" onClick={() => open(url)}>
|
||||
{children}
|
||||
</IconButton>
|
||||
);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Box, Button, makeStyles, Typography } from "@material-ui/core";
|
||||
import { open } from "@tauri-apps/plugin-shell";
|
||||
import InfoBox from "../../modal/swap/InfoBox";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
|
@ -27,19 +28,13 @@ export default function ContactInfoBox() {
|
|||
}
|
||||
additionalContent={
|
||||
<Box className={classes.spacedBox}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={() => window.open(GITHUB_ISSUE_URL)}
|
||||
>
|
||||
<Button variant="outlined" onClick={() => open(GITHUB_ISSUE_URL)}>
|
||||
Open GitHub issue
|
||||
</Button>
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={() => window.open(MATRIX_ROOM_URL)}
|
||||
>
|
||||
<Button variant="outlined" onClick={() => open(MATRIX_ROOM_URL)}>
|
||||
Join Matrix room
|
||||
</Button>
|
||||
<Button variant="outlined" onClick={() => window.open(DISCORD_URL)}>
|
||||
<Button variant="outlined" onClick={() => open(DISCORD_URL)}>
|
||||
Join Discord
|
||||
</Button>
|
||||
</Box>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue