This adds a completely separate frontend based on React because I found that code gen works better with React once the application gets bigger. In particular it was getting very hard to move past add connectors and actions. The idea is to replace the standard UI with this once it has been tested. But for now it is available at /app in addition to the original at / Signed-off-by: Richard Palethorpe <io@richiejp.com>
42 lines
1.4 KiB
JavaScript
42 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
|
|
/**
|
|
* Twitter Post action component
|
|
*/
|
|
const TwitterPostAction = ({ index, onActionConfigChange, getConfigValue }) => {
|
|
return (
|
|
<div className="twitter-post-action">
|
|
<div className="form-group mb-3">
|
|
<label htmlFor={`twitterToken${index}`}>Twitter API Token</label>
|
|
<input
|
|
type="text"
|
|
id={`twitterToken${index}`}
|
|
value={getConfigValue('token', '')}
|
|
onChange={(e) => onActionConfigChange('token', e.target.value)}
|
|
className="form-control"
|
|
placeholder="Twitter API token"
|
|
/>
|
|
<small className="form-text text-muted">Twitter API token with posting permissions</small>
|
|
</div>
|
|
|
|
<div className="form-group mb-3">
|
|
<div className="form-check">
|
|
<input
|
|
type="checkbox"
|
|
id={`noCharacterLimits${index}`}
|
|
checked={getConfigValue('noCharacterLimits', '') === 'true'}
|
|
onChange={(e) => onActionConfigChange('noCharacterLimits', e.target.checked ? 'true' : 'false')}
|
|
className="form-check-input"
|
|
/>
|
|
<label className="form-check-label" htmlFor={`noCharacterLimits${index}`}>
|
|
Disable character limit (280 characters)
|
|
</label>
|
|
<small className="form-text text-muted d-block">Enable to bypass the 280 character limit check</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default TwitterPostAction;
|