|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
- auto saves ,ajax call |
|
|
|
|
- auto saves ,ajax call (submit when blur or onEnter) |
|
|
|
|
- set default text |
|
|
|
|
- show error state/confirm states |
|
|
|
|
- show info |
|
|
|
|
@ -16,10 +16,49 @@ update vals to state, andthru api.
@@ -16,10 +16,49 @@ update vals to state, andthru api.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
import React, { useContext } from 'react'; |
|
|
|
|
import { ServerStatusContext } from '../../../utils/server-status-context'; |
|
|
|
|
import React from 'react'; |
|
|
|
|
import { Form, Input } from 'antd'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface TextFieldProps { |
|
|
|
|
onSubmit: (value: string) => void; |
|
|
|
|
label: string; |
|
|
|
|
defaultValue: string; |
|
|
|
|
value: string; |
|
|
|
|
helpInfo: string; |
|
|
|
|
maxLength: number; |
|
|
|
|
type: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Server Name |
|
|
|
|
<Input placeholder="Owncast" value={name} /> |
|
|
|
|
// // do i need this?
|
|
|
|
|
// export const initialProps: TextFieldProps = {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
export const TEXTFIELD_TYPE_TEXT = 'default'; |
|
|
|
|
export const TEXTFIELD_TYPE_PASSWORD = 'password'; //Input.Password
|
|
|
|
|
export const TEXTFIELD_TYPE_NUMBER = 'numeric'; |
|
|
|
|
|
|
|
|
|
export default function TextField(props: TextFieldProps) { |
|
|
|
|
const { |
|
|
|
|
label, |
|
|
|
|
defaultValue, |
|
|
|
|
value, |
|
|
|
|
onSubmit, |
|
|
|
|
helpInfo, |
|
|
|
|
maxLength, |
|
|
|
|
type, |
|
|
|
|
} = props; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="textfield"> |
|
|
|
|
<Form.Item |
|
|
|
|
label={label} |
|
|
|
|
hasFeedback |
|
|
|
|
validateStatus="error" |
|
|
|
|
help="Should be combination of numbers & alphabets" |
|
|
|
|
> |
|
|
|
|
<Input placeholder="Owncast" value={value} /> |
|
|
|
|
</Form.Item> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|