mirror of
https://github.com/owncast/owncast.git
synced 2024-11-26 06:46:01 +03:00
make basic form field wit no submit, so a submit text field can compose it
This commit is contained in:
parent
b37b57feda
commit
579a0a8838
2 changed files with 18 additions and 5 deletions
|
@ -4,6 +4,8 @@ import { Typography, Tag, Input } from 'antd';
|
|||
|
||||
import { ServerStatusContext } from '../../../utils/server-status-context';
|
||||
import { FIELD_PROPS_TAGS, RESET_TIMEOUT, SUCCESS_STATES, postConfigUpdateToAPI } from './constants';
|
||||
import TextField from './form-textfield-nosubmit';
|
||||
import { UpdateArgs } from '../../../types/config-section';
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
|
@ -59,11 +61,11 @@ export default function EditInstanceTags() {
|
|||
});
|
||||
};
|
||||
|
||||
const handleInputChange = e => {
|
||||
const handleInputChange = ({ value }: UpdateArgs) => {
|
||||
if (submitStatusMessage !== '') {
|
||||
setSubmitStatusMessage('');
|
||||
}
|
||||
setNewTagInput(e.target.value);
|
||||
setNewTagInput(value);
|
||||
};
|
||||
|
||||
// send to api and do stuff
|
||||
|
@ -115,7 +117,18 @@ export default function EditInstanceTags() {
|
|||
{newStatusIcon} {newStatusMessage} {submitStatusMessage}
|
||||
</div>
|
||||
<div className="add-new-tag-section">
|
||||
<Input
|
||||
<TextField
|
||||
fieldName="tag-input"
|
||||
value={newTagInput}
|
||||
className="new-tag-input"
|
||||
onChange={handleInputChange}
|
||||
onPressEnter={handleSubmitNewTag}
|
||||
maxLength={maxLength}
|
||||
placeholder={placeholder}
|
||||
|
||||
message={`${newStatusIcon} ${newStatusMessage} ${submitStatusMessage}`}
|
||||
/>
|
||||
{/* <Input
|
||||
type="text"
|
||||
className="new-tag-input"
|
||||
value={newTagInput}
|
||||
|
@ -124,7 +137,7 @@ export default function EditInstanceTags() {
|
|||
maxLength={maxLength}
|
||||
placeholder={placeholder}
|
||||
allowClear
|
||||
/>
|
||||
/> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ import StatisticItem from "./components/statistic"
|
|||
import LogTable from "./components/log-table";
|
||||
import Offline from './offline-notice';
|
||||
import TextField from './components/config/form-textfield';
|
||||
import { API_STREAM_TITLE, postConfigUpdateToAPI, TEXTFIELD_PROPS_STREAM_TITLE } from './components/config/constants';
|
||||
import { TEXTFIELD_PROPS_STREAM_TITLE } from './components/config/constants';
|
||||
|
||||
import {
|
||||
LOGS_WARN,
|
||||
|
|
Loading…
Reference in a new issue