Path: blob/master/src/packages/frontend/account/settings/text-setting.tsx
1503 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Input } from "antd";67import { LabeledRow } from "../../components";89// in a grid: Title [text input]10interface Props {11label: string;12value?: string;13onChange: (e) => void;14onBlur?: (e) => void;15onFocus?: () => void;16onPressEnter?: (e) => void;17maxLength?: number;18disabled?: boolean;19}202122// Note -- we disable all password manager autocomplete, since this is a component23// that's used internally in the app for configuration. See https://github.com/sagemathinc/cocalc/issues/68682425export function TextSetting(props: Props): React.JSX.Element {26return (27<LabeledRow28label={props.label}29style={props.disabled ? { color: "#666" } : undefined}30>31<Input32value={props.value}33onChange={props.onChange}34onBlur={props.onBlur}35onFocus={props.onFocus}36onPressEnter={props.onPressEnter}37maxLength={props.maxLength}38disabled={props.disabled}39autoComplete={"off"}40data-lpignore="true"41data-1p-ignore42/>43</LabeledRow>44);45}464748