1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

#58 using formik at node submit form

This commit is contained in:
Fedor Katurov 2021-03-26 17:52:24 +07:00
parent 4b542e0291
commit b871cc2042
17 changed files with 230 additions and 423 deletions

View file

@ -0,0 +1,35 @@
import React, { FC } from 'react';
import { EditorActionsPanel } from '~/components/editors/EditorActionsPanel';
import { Group } from '~/components/containers/Group';
import { InputText } from '~/components/input/InputText';
import { Button } from '~/components/input/Button';
import { Padder } from '~/components/containers/Padder';
import { useNodeFormContext } from '~/utils/hooks/useNodeFormFormik';
const EditorButtons: FC = () => {
const { values, handleChange } = useNodeFormContext();
return (
<Padder style={{ position: 'relative' }}>
<EditorActionsPanel />
<Group horizontal>
<InputText
title="Название"
value={values.title}
handler={handleChange('title')}
autoFocus
maxLength={256}
/>
<Button
title="Сохранить"
iconRight="check"
color={values.is_promoted ? 'primary' : 'lab'}
/>
</Group>
</Padder>
);
};
export { EditorButtons };