mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-20 13:28:20 +02:00
* Add twitter stream class * Got twitter forwarder subscription working * Add config table in db with twitter bearer token * Only run forward tweets task when twitter bearer token and twitter handles are not null * Add twitter page to frontend and add button to set bearer token * Reload bearer token in ui after setting value * Add twitter accounts table to db * Got get twitter accounts request working * Display twitter account list items in twitter page * Show twitter accounts in twitter page * Got create squeak from tweet working * Update twitter stream upon twitter accounts changes * Got terminate twitter stream connection working * Update frontend build * Remove print statements from itest * Remove main function from twitter stream module * Make tweet forwarder worker run as daemon thread * Use custom config for subscribe tweets retry interval
80 lines
1.8 KiB
JavaScript
80 lines
1.8 KiB
JavaScript
import React from 'react';
|
|
import {
|
|
Dialog,
|
|
DialogTitle,
|
|
DialogContent,
|
|
DialogActions,
|
|
Button,
|
|
} from '@material-ui/core';
|
|
|
|
// styles
|
|
import useStyles from './styles';
|
|
|
|
import {
|
|
deleteTwitterAccountRequest,
|
|
} from '../../squeakclient/requests';
|
|
|
|
export default function DeleteTwitterAccountDialog({
|
|
open,
|
|
handleClose,
|
|
twitterAccount,
|
|
reloadAccountsFn,
|
|
...props
|
|
}) {
|
|
const classes = useStyles();
|
|
|
|
const deleteTwitterAccount = (twitterAccountId) => {
|
|
deleteTwitterAccountRequest(twitterAccountId, (response) => {
|
|
reloadAccountsFn();
|
|
});
|
|
};
|
|
|
|
function handleSubmit(event) {
|
|
event.preventDefault();
|
|
console.log('twitter account:', twitterAccount);
|
|
const twitterAccountId = twitterAccount.getTwitterAccountId();
|
|
console.log('twitterAccountId:', twitterAccountId);
|
|
deleteTwitterAccount(twitterAccountId);
|
|
handleClose();
|
|
}
|
|
|
|
function MakeCancelButton() {
|
|
return (
|
|
<Button
|
|
onClick={handleClose}
|
|
variant="contained"
|
|
color="secondary"
|
|
>
|
|
Cancel
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
function DeleteTwitterAccountButton() {
|
|
return (
|
|
<Button
|
|
type="submit"
|
|
variant="contained"
|
|
color="primary"
|
|
className={classes.button}
|
|
>
|
|
Delete Twitter Account
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
|
|
<DialogTitle id="form-dialog-title">Delete Twitter Account Mapping</DialogTitle>
|
|
<form className={classes.root} onSubmit={handleSubmit} noValidate autoComplete="off">
|
|
<DialogContent>
|
|
Are you sure you want to delete this twitter account mapping?
|
|
</DialogContent>
|
|
<DialogActions>
|
|
{MakeCancelButton()}
|
|
{DeleteTwitterAccountButton()}
|
|
</DialogActions>
|
|
</form>
|
|
</Dialog>
|
|
);
|
|
}
|