CustomBotNonProxySettings.jsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* eslint-disable no-console */
  2. import React, { useState } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
  5. function CustomBotNonProxySettings() {
  6. const { t } = useTranslation('admin');
  7. const [secret, setSecret] = useState('');
  8. const [token, setToken] = useState('');
  9. function updateHandler() {
  10. console.log(`Signing Secret: ${secret}, Bot User OAuth Token: ${token}`);
  11. }
  12. return (
  13. <>
  14. <div className="row my-5">
  15. <div className="mx-auto">
  16. <button type="button" className="btn btn-primary text-nowrap mx-1" onClick={() => window.open('https://api.slack.com/apps', '_blank')}>
  17. {t('slack_integration.non_proxy.create_bot')}
  18. </button>
  19. </div>
  20. </div>
  21. <div className="form-group row">
  22. <label className="text-left text-md-right col-md-3 col-form-label">Signing Secret</label>
  23. <div className="col-md-6">
  24. <input
  25. className="form-control"
  26. type="text"
  27. onChange={e => setSecret(e.target.value)}
  28. />
  29. </div>
  30. </div>
  31. <div className="form-group row mb-5">
  32. <label className="text-left text-md-right col-md-3 col-form-label">Bot User OAuth Token</label>
  33. <div className="col-md-6">
  34. <input
  35. className="form-control"
  36. type="text"
  37. onChange={e => setToken(e.target.value)}
  38. />
  39. </div>
  40. </div>
  41. <AdminUpdateButtonRow onClick={updateHandler} disabled={false} />
  42. </>
  43. );
  44. }
  45. export default CustomBotNonProxySettings;