You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
630 B
TypeScript
30 lines
630 B
TypeScript
5 years ago
|
import React from 'react';
|
||
|
|
||
|
|
||
|
interface Props {
|
||
|
placeholder: string;
|
||
|
editable?: boolean;
|
||
|
onChange?: any;
|
||
|
}
|
||
|
|
||
|
|
||
|
export class SessionIdEditable extends React.PureComponent<Props> {
|
||
|
|
||
|
public render() {
|
||
|
const { placeholder, editable, onChange } = this.props;
|
||
|
|
||
|
return (
|
||
|
<div
|
||
|
className="session-id-editable"
|
||
|
placeholder={placeholder}
|
||
|
contentEditable={editable}
|
||
|
onInput={(e: any) => {
|
||
|
if (editable) {
|
||
|
onChange(e);
|
||
|
}
|
||
|
}}
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
}
|