mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-19 13:18:26 +02:00
Use dialog for create profile (#183)
* Use dialog for create signing profile * Create signing profile dialog working * Add create contact profile dialog * Delete create signing profile page and create contact profile page
This commit is contained in:
parent
80713c94ea
commit
9a7d034771
14 changed files with 451 additions and 228 deletions
|
|
@ -0,0 +1,166 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {
|
||||
Paper,
|
||||
IconButton,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Typography,
|
||||
Grid,
|
||||
Box,
|
||||
Link,
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
TextField,
|
||||
DialogActions,
|
||||
Button,
|
||||
FormControl,
|
||||
InputLabel,
|
||||
Select,
|
||||
} from "@material-ui/core";
|
||||
import { MoreVert as MoreIcon } from "@material-ui/icons";
|
||||
import {useHistory} from "react-router-dom";
|
||||
import classnames from "classnames";
|
||||
|
||||
// styles
|
||||
import useStyles from "./styles";
|
||||
|
||||
import Widget from "../../components/Widget";
|
||||
import SqueakThreadItem from "../../components/SqueakThreadItem";
|
||||
|
||||
import {
|
||||
CreateContactProfileRequest,
|
||||
} from "../../proto/squeak_admin_pb"
|
||||
import {SqueakAdminClient} from "../../proto/squeak_admin_grpc_web_pb"
|
||||
|
||||
var client = new SqueakAdminClient('http://' + window.location.hostname + ':8080')
|
||||
|
||||
export default function CreateContactProfileDialog({
|
||||
open,
|
||||
handleClose,
|
||||
...props
|
||||
}) {
|
||||
var classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
var [profileName, setProfileName] = useState('');
|
||||
var [address, setAddress] = useState('');
|
||||
|
||||
const handleChangeProfileName = (event) => {
|
||||
setProfileName(event.target.value);
|
||||
};
|
||||
|
||||
const handleChangeAddress = (event) => {
|
||||
setAddress(event.target.value);
|
||||
};
|
||||
|
||||
const createContactProfile = (profileName, squeakAddress) => {
|
||||
console.log("called createContactProfile");
|
||||
|
||||
var createContactProfileRequest = new CreateContactProfileRequest()
|
||||
createContactProfileRequest.setProfileName(profileName);
|
||||
createContactProfileRequest.setAddress(squeakAddress);
|
||||
console.log(createContactProfileRequest);
|
||||
|
||||
client.createContactProfile(createContactProfileRequest, {}, (err, response) => {
|
||||
if (err) {
|
||||
console.log(err.message);
|
||||
alert('Error creating contact profile: ' + err.message);
|
||||
return;
|
||||
}
|
||||
console.log(response);
|
||||
console.log(response.getProfileId());
|
||||
goToProfilePage(response.getProfileId());
|
||||
});
|
||||
};
|
||||
|
||||
const goToProfilePage = (profileId) => {
|
||||
history.push("/app/profile/" + profileId);
|
||||
};
|
||||
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
console.log( 'profileName:', profileName);
|
||||
console.log( 'address:', address);
|
||||
if (!profileName) {
|
||||
alert('Profile Name cannot be empty.');
|
||||
return;
|
||||
}
|
||||
if (!address) {
|
||||
alert('Address Name cannot be empty.');
|
||||
return;
|
||||
}
|
||||
createContactProfile(profileName, address);
|
||||
handleClose();
|
||||
}
|
||||
|
||||
function CreateContactProfileNameInput() {
|
||||
return (
|
||||
<TextField
|
||||
id="standard-textarea"
|
||||
label="Profile Name"
|
||||
required
|
||||
autoFocus
|
||||
value={profileName}
|
||||
onChange={handleChangeProfileName}
|
||||
fullWidth
|
||||
inputProps={{ maxLength: 64 }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function CreateContactAddressInput() {
|
||||
return (
|
||||
<TextField required
|
||||
id="standard-textarea"
|
||||
label="Address"
|
||||
required
|
||||
value={address}
|
||||
onChange={handleChangeAddress}
|
||||
inputProps={{ maxLength: 35 }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function CancelButton() {
|
||||
return (
|
||||
<Button
|
||||
onClick={handleClose}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
function CreateContactProfilButton() {
|
||||
return (
|
||||
<Button
|
||||
type="submit"
|
||||
variant="contained"
|
||||
color="primary"
|
||||
className={classes.button}
|
||||
>
|
||||
Create Contact Profile
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
|
||||
<DialogTitle id="form-dialog-title">Create Contact Profile</DialogTitle>
|
||||
<form className={classes.root} onSubmit={handleSubmit} noValidate autoComplete="off">
|
||||
<DialogContent>
|
||||
{CreateContactProfileNameInput()}
|
||||
{CreateContactAddressInput()}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
{CancelButton()}
|
||||
{CreateContactProfilButton()}
|
||||
</DialogActions>
|
||||
</form>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "CreateContactProfileDialog",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "CreateContactProfileDialog.js"
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import { makeStyles } from "@material-ui/styles";
|
||||
|
||||
export default makeStyles(theme => ({
|
||||
widgetWrapper: {
|
||||
display: "flex",
|
||||
minHeight: "100%",
|
||||
},
|
||||
widgetHeader: {
|
||||
padding: theme.spacing(3),
|
||||
paddingBottom: theme.spacing(1),
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
},
|
||||
widgetRoot: {
|
||||
boxShadow: theme.customShadows.widget,
|
||||
},
|
||||
widgetBody: {
|
||||
paddingBottom: theme.spacing(3),
|
||||
paddingRight: theme.spacing(3),
|
||||
paddingLeft: theme.spacing(3),
|
||||
},
|
||||
noPadding: {
|
||||
padding: 0,
|
||||
},
|
||||
paper: {
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
flexGrow: 1,
|
||||
overflow: "hidden",
|
||||
},
|
||||
moreButton: {
|
||||
margin: -theme.spacing(1),
|
||||
padding: 0,
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: theme.palette.text.hint,
|
||||
"&:hover": {
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
color: "rgba(255, 255, 255, 0.35)",
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {
|
||||
Paper,
|
||||
IconButton,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Typography,
|
||||
Grid,
|
||||
Box,
|
||||
Link,
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
TextField,
|
||||
DialogActions,
|
||||
Button,
|
||||
FormControl,
|
||||
InputLabel,
|
||||
Select,
|
||||
} from "@material-ui/core";
|
||||
import { MoreVert as MoreIcon } from "@material-ui/icons";
|
||||
import {useHistory} from "react-router-dom";
|
||||
import classnames from "classnames";
|
||||
|
||||
// styles
|
||||
import useStyles from "./styles";
|
||||
|
||||
import Widget from "../../components/Widget";
|
||||
import SqueakThreadItem from "../../components/SqueakThreadItem";
|
||||
|
||||
import {
|
||||
CreateSigningProfileRequest,
|
||||
} from "../../proto/squeak_admin_pb"
|
||||
import {SqueakAdminClient} from "../../proto/squeak_admin_grpc_web_pb"
|
||||
|
||||
var client = new SqueakAdminClient('http://' + window.location.hostname + ':8080')
|
||||
|
||||
export default function CreateSigningProfileDialog({
|
||||
open,
|
||||
handleClose,
|
||||
...props
|
||||
}) {
|
||||
var classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
var [profileName, setProfileName] = useState('');
|
||||
|
||||
const handleChangeProfileName = (event) => {
|
||||
setProfileName(event.target.value);
|
||||
};
|
||||
|
||||
const createSigningProfile = (profileName) => {
|
||||
console.log("called createSigningProfile");
|
||||
|
||||
var createSigningProfileRequest = new CreateSigningProfileRequest()
|
||||
createSigningProfileRequest.setProfileName(profileName);
|
||||
console.log(createSigningProfileRequest);
|
||||
|
||||
client.createSigningProfile(createSigningProfileRequest, {}, (err, response) => {
|
||||
if (err) {
|
||||
console.log(err.message);
|
||||
alert('Error creating signing profile: ' + err.message);
|
||||
return;
|
||||
}
|
||||
console.log(response);
|
||||
console.log(response.getProfileId());
|
||||
goToProfilePage(response.getProfileId());
|
||||
});
|
||||
};
|
||||
|
||||
const goToProfilePage = (profileId) => {
|
||||
history.push("/app/profile/" + profileId);
|
||||
};
|
||||
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
console.log( 'profileName:', profileName);
|
||||
if (!profileName) {
|
||||
alert('Profile Name cannot be empty.');
|
||||
return;
|
||||
}
|
||||
createSigningProfile(profileName);
|
||||
handleClose();
|
||||
}
|
||||
|
||||
function CreateSigningProfileNameInput() {
|
||||
return (
|
||||
<TextField
|
||||
id="standard-textarea"
|
||||
label="Profile Name"
|
||||
required
|
||||
autoFocus
|
||||
value={profileName}
|
||||
onChange={handleChangeProfileName}
|
||||
fullWidth
|
||||
inputProps={{ maxLength: 64 }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function CancelButton() {
|
||||
return (
|
||||
<Button
|
||||
onClick={handleClose}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
function CreateSigningProfilButton() {
|
||||
return (
|
||||
<Button
|
||||
type="submit"
|
||||
variant="contained"
|
||||
color="primary"
|
||||
className={classes.button}
|
||||
>
|
||||
Create Signing Profile
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
|
||||
<DialogTitle id="form-dialog-title">Create Signing Profile</DialogTitle>
|
||||
<form className={classes.root} onSubmit={handleSubmit} noValidate autoComplete="off">
|
||||
<DialogContent>
|
||||
{CreateSigningProfileNameInput()}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
{CancelButton()}
|
||||
{CreateSigningProfilButton()}
|
||||
</DialogActions>
|
||||
</form>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "CreateSigningProfileDialog",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "CreateSigningProfileDialog.js"
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import { makeStyles } from "@material-ui/styles";
|
||||
|
||||
export default makeStyles(theme => ({
|
||||
widgetWrapper: {
|
||||
display: "flex",
|
||||
minHeight: "100%",
|
||||
},
|
||||
widgetHeader: {
|
||||
padding: theme.spacing(3),
|
||||
paddingBottom: theme.spacing(1),
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
},
|
||||
widgetRoot: {
|
||||
boxShadow: theme.customShadows.widget,
|
||||
},
|
||||
widgetBody: {
|
||||
paddingBottom: theme.spacing(3),
|
||||
paddingRight: theme.spacing(3),
|
||||
paddingLeft: theme.spacing(3),
|
||||
},
|
||||
noPadding: {
|
||||
padding: 0,
|
||||
},
|
||||
paper: {
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
flexGrow: 1,
|
||||
overflow: "hidden",
|
||||
},
|
||||
moreButton: {
|
||||
margin: -theme.spacing(1),
|
||||
padding: 0,
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: theme.palette.text.hint,
|
||||
"&:hover": {
|
||||
backgroundColor: theme.palette.primary.main,
|
||||
color: "rgba(255, 255, 255, 0.35)",
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
@ -20,8 +20,6 @@ import Dashboard from "../../pages/dashboard";
|
|||
import SqueakAddress from "../../pages/squeakaddress";
|
||||
import Squeak from "../../pages/squeak";
|
||||
import Profile from "../../pages/profile";
|
||||
import CreateSigningProfile from "../../pages/createsigningprofile";
|
||||
import CreateContactProfile from "../../pages/createcontactprofile";
|
||||
import Lightning from "../../pages/lightning";
|
||||
import Notifications from "../../pages/notifications";
|
||||
import Maps from "../../pages/maps";
|
||||
|
|
@ -55,8 +53,6 @@ function Layout(props) {
|
|||
<Route path="/app/squeakaddress/:address" component={SqueakAddress} />
|
||||
<Route path="/app/squeak/:hash" component={Squeak} />
|
||||
<Route path="/app/profile/:id" component={Profile} />
|
||||
<Route path="/app/createsigningprofile" component={CreateSigningProfile} />
|
||||
<Route path="/app/createcontactprofile" component={CreateContactProfile} />
|
||||
<Route path="/app/profiles" component={Profiles} />
|
||||
<Route path="/app/lightning" component={Lightning} />
|
||||
<Route path="/app/notifications" component={Notifications} />
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {useHistory} from "react-router-dom";
|
||||
import {Grid, TextField, Button, Typography, Paper} from "@material-ui/core";
|
||||
|
||||
// styles
|
||||
import useStyles from "./styles";
|
||||
|
||||
// components
|
||||
import PageTitle from "../../components/PageTitle";
|
||||
import Widget from "../../components/Widget";
|
||||
// import { Typography } from "../../components/Wrappers";
|
||||
|
||||
import {CreateContactProfileRequest} from "../../proto/squeak_admin_pb"
|
||||
import {SqueakAdminClient} from "../../proto/squeak_admin_grpc_web_pb"
|
||||
|
||||
var client = new SqueakAdminClient('http://' + window.location.hostname + ':8080')
|
||||
|
||||
export default function CreateContactProfilePage() {
|
||||
const [profileName, setProfileName] = useState('');
|
||||
const [address, setAddress] = useState('');
|
||||
|
||||
var classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
const goToProfilePage = (profileId) => {
|
||||
history.push("/app/profile/" + profileId);
|
||||
};
|
||||
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
console.log( 'profileName:', profileName);
|
||||
console.log( 'address:', address);
|
||||
// You should see email and password in console.
|
||||
// ..code to submit form to backend here...
|
||||
createContactProfile(profileName, address);
|
||||
}
|
||||
|
||||
const createContactProfile = (profileName, squeakAddress) => {
|
||||
console.log("called createContactProfile");
|
||||
|
||||
var createContactProfileRequest = new CreateContactProfileRequest()
|
||||
createContactProfileRequest.setProfileName(profileName);
|
||||
createContactProfileRequest.setAddress(squeakAddress);
|
||||
console.log(createContactProfileRequest);
|
||||
|
||||
client.createContactProfile(createContactProfileRequest, {}, (err, response) => {
|
||||
if (err) {
|
||||
console.log(err.message);
|
||||
alert('Error creating contact profile: ' + err.message);
|
||||
return;
|
||||
}
|
||||
console.log(response);
|
||||
console.log(response.getProfileId());
|
||||
goToProfilePage(response.getProfileId());
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
< PageTitle title = "Create Contact Profile" />
|
||||
<Paper>
|
||||
<form className={classes.root} onSubmit={handleSubmit} >
|
||||
<TextField required
|
||||
value={profileName}
|
||||
label="Profile name"
|
||||
onInput={ e=>setProfileName(e.target.value)}
|
||||
/>
|
||||
<TextField required
|
||||
value={address}
|
||||
label="Address"
|
||||
onInput={ e=>setAddress(e.target.value)}
|
||||
/>
|
||||
<Typography className={classes.divider} />
|
||||
<Button
|
||||
type="submit"
|
||||
variant="contained"
|
||||
className={classes.button}
|
||||
>
|
||||
Create
|
||||
</Button>
|
||||
</form>
|
||||
</Paper>
|
||||
</>);
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "CreateContactProfile",
|
||||
"version": "0.0.0",
|
||||
"main": "CreateContactProfile.js",
|
||||
"private": true
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import { makeStyles } from "@material-ui/styles";
|
||||
|
||||
export default makeStyles(theme => ({
|
||||
dashedBorder: {
|
||||
border: "1px dashed",
|
||||
borderColor: theme.palette.primary.main,
|
||||
padding: theme.spacing(2),
|
||||
paddingTop: theme.spacing(4),
|
||||
paddingBottom: theme.spacing(4),
|
||||
marginTop: theme.spacing(1),
|
||||
},
|
||||
text: {
|
||||
marginBottom: theme.spacing(2),
|
||||
},
|
||||
root: {
|
||||
'& .MuiTextField-root': {
|
||||
margin: theme.spacing(1),
|
||||
width: '25ch',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {useHistory} from "react-router-dom";
|
||||
import {Grid, TextField, Button, Typography, Paper} from "@material-ui/core";
|
||||
|
||||
// styles
|
||||
import useStyles from "./styles";
|
||||
|
||||
// components
|
||||
import PageTitle from "../../components/PageTitle";
|
||||
import Widget from "../../components/Widget";
|
||||
// import { Typography } from "../../components/Wrappers";
|
||||
|
||||
import {CreateSigningProfileRequest} from "../../proto/squeak_admin_pb"
|
||||
import {SqueakAdminClient} from "../../proto/squeak_admin_grpc_web_pb"
|
||||
|
||||
var client = new SqueakAdminClient('http://' + window.location.hostname + ':8080')
|
||||
|
||||
export default function CreateSigningProfilePage() {
|
||||
const [profileName, setProfileName] = useState('');
|
||||
|
||||
var classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
const goToProfilePage = (profileId) => {
|
||||
history.push("/app/profile/" + profileId);
|
||||
};
|
||||
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
console.log( 'profileName:', profileName);
|
||||
// You should see email and password in console.
|
||||
// ..code to submit form to backend here...
|
||||
createSigningProfile(profileName)
|
||||
}
|
||||
|
||||
const createSigningProfile = (profileName) => {
|
||||
console.log("called createSigningProfile");
|
||||
|
||||
var createSigningProfileRequest = new CreateSigningProfileRequest()
|
||||
createSigningProfileRequest.setProfileName(profileName);
|
||||
console.log(createSigningProfileRequest);
|
||||
|
||||
client.createSigningProfile(createSigningProfileRequest, {}, (err, response) => {
|
||||
if (err) {
|
||||
console.log(err.message);
|
||||
alert('Error creating signing profile: ' + err.message);
|
||||
return;
|
||||
}
|
||||
console.log(response);
|
||||
console.log(response.getProfileId());
|
||||
goToProfilePage(response.getProfileId());
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
< PageTitle title = "Create Signing Profile" />
|
||||
<Paper>
|
||||
<form className={classes.root} onSubmit={handleSubmit} >
|
||||
<TextField required
|
||||
value={profileName}
|
||||
label="Profile name"
|
||||
onInput={ e=>setProfileName(e.target.value)}
|
||||
/>
|
||||
<Typography className={classes.divider} />
|
||||
<Button
|
||||
type="submit"
|
||||
variant="contained"
|
||||
className={classes.button}
|
||||
>
|
||||
Create
|
||||
</Button>
|
||||
</form>
|
||||
</Paper>
|
||||
</>);
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "CreateSigningProfile",
|
||||
"version": "0.0.0",
|
||||
"main": "CreateSigningProfile.js",
|
||||
"private": true
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import { makeStyles } from "@material-ui/styles";
|
||||
|
||||
export default makeStyles(theme => ({
|
||||
dashedBorder: {
|
||||
border: "1px dashed",
|
||||
borderColor: theme.palette.primary.main,
|
||||
padding: theme.spacing(2),
|
||||
paddingTop: theme.spacing(4),
|
||||
paddingBottom: theme.spacing(4),
|
||||
marginTop: theme.spacing(1),
|
||||
},
|
||||
text: {
|
||||
marginBottom: theme.spacing(2),
|
||||
},
|
||||
root: {
|
||||
'& .MuiTextField-root': {
|
||||
margin: theme.spacing(1),
|
||||
width: '25ch',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
@ -19,6 +19,8 @@ import {makeStyles} from '@material-ui/core/styles';
|
|||
import PageTitle from "../../components/PageTitle";
|
||||
import Widget from "../../components/Widget";
|
||||
import Table from "../dashboard/components/Table/Table";
|
||||
import CreateSigningProfileDialog from "../../components/CreateSigningProfileDialog";
|
||||
import CreateContactProfileDialog from "../../components/CreateContactProfileDialog";
|
||||
|
||||
// data
|
||||
import mock from "../dashboard/mock";
|
||||
|
|
@ -99,6 +101,8 @@ export default function Profiles() {
|
|||
const classes = useStyles();
|
||||
const [signingProfiles, setSigningProfiles] = useState([]);
|
||||
const [contactProfiles, setContactProfiles] = useState([]);
|
||||
const [createSigningProfileDialogOpen, setCreateSigningProfileDialogOpen] = useState(false);
|
||||
const [createContactProfileDialogOpen, setCreateContactProfileDialogOpen] = useState(false);
|
||||
const [value, setValue] = useState(0);
|
||||
const history = useHistory();
|
||||
|
||||
|
|
@ -155,18 +159,26 @@ export default function Profiles() {
|
|||
});
|
||||
};
|
||||
|
||||
const goToCreateSigningProfilePage = () => {
|
||||
history.push("/app/createsigningprofile");
|
||||
};
|
||||
|
||||
const goToCreateContactProfilePage = () => {
|
||||
history.push("/app/createcontactprofile");
|
||||
};
|
||||
|
||||
const goToSqueakAddressPage = (squeakAddress) => {
|
||||
history.push("/app/squeakaddress/" + squeakAddress);
|
||||
};
|
||||
|
||||
const handleClickOpenCreateSigningProfileDialog = () => {
|
||||
setCreateSigningProfileDialogOpen(true);
|
||||
};
|
||||
|
||||
const handleCloseCreateSigningProfileDialog = () => {
|
||||
setCreateSigningProfileDialogOpen(false);
|
||||
};
|
||||
|
||||
const handleClickOpenCreateContactProfileDialog = () => {
|
||||
setCreateContactProfileDialogOpen(true);
|
||||
};
|
||||
|
||||
const handleCloseCreateContactProfileDialog = () => {
|
||||
setCreateContactProfileDialogOpen(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getLndInfo()
|
||||
}, []);
|
||||
|
|
@ -222,7 +234,7 @@ export default function Profiles() {
|
|||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
goToCreateSigningProfilePage();
|
||||
handleClickOpenCreateSigningProfileDialog();
|
||||
}}>Create Signing Profile
|
||||
</Button>
|
||||
</div>
|
||||
|
|
@ -239,7 +251,7 @@ export default function Profiles() {
|
|||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
goToCreateContactProfilePage();
|
||||
handleClickOpenCreateContactProfileDialog();
|
||||
}}>Add contact
|
||||
</Button>
|
||||
</div>
|
||||
|
|
@ -314,9 +326,33 @@ export default function Profiles() {
|
|||
)
|
||||
}
|
||||
|
||||
function CreateSigningProfileDialogContent() {
|
||||
return (
|
||||
<>
|
||||
<CreateSigningProfileDialog
|
||||
open={createSigningProfileDialogOpen}
|
||||
handleClose={handleCloseCreateSigningProfileDialog}
|
||||
></CreateSigningProfileDialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function CreateContactProfileDialogContent() {
|
||||
return (
|
||||
<>
|
||||
<CreateContactProfileDialog
|
||||
open={createContactProfileDialogOpen}
|
||||
handleClose={handleCloseCreateContactProfileDialog}
|
||||
></CreateContactProfileDialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
< PageTitle title = "Profiles" />
|
||||
{ProfilesTabs()}
|
||||
{CreateSigningProfileDialogContent()}
|
||||
{CreateContactProfileDialogContent()}
|
||||
< />);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue