import React, { useState } from 'react'; import classNames from 'classnames'; import { CheckBox } from './CheckBox'; import { FieldError, StandaloneFieldError } from './FieldError'; import { TagInput } from './TagInput'; import { MetadataPreview } from './MetadataPreview'; type CheckinFormProps = { initialState: any; }; export const CheckinForm: React.FC = ({ initialState }) => { const [date, setDate] = useState(initialState.fields.date || ''); const [time, setTime] = useState(initialState.fields.time || ''); const [tags, setTags] = useState(initialState.fields.tags || []); const [link, setLink] = useState(initialState.fields.link || ''); const [linkForPreview, setLinkForPreview] = useState(link); const [note, setNote] = useState(initialState.fields.note || ''); const [isPrivate, setPrivate] = useState(!!initialState.fields.is_private); const [isTooSensitive, setTooSensitive] = useState(!!initialState.fields.is_too_sensitive); return ( <>
setDate(e.target.value)} />
setTime(e.target.value)} />
setTags(v)} /> Tab, Enter, 半角スペースのいずれかで入力確定します。
setLink(e.target.value)} onBlur={() => setLinkForPreview(link)} /> オカズのURLを貼り付けて登録することができます。
setTags(tags.concat(v))} />