extract date fields macro

This commit is contained in:
Jan Prochazka
2020-11-01 12:46:34 +01:00
parent ab2fb3bf97
commit 8ff44e41b1
3 changed files with 126 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import React from 'react';
import _ from 'lodash';
import styled from 'styled-components';
import {
FormTextField,
FormSubmit,
@@ -11,6 +12,9 @@ import {
} from '../utility/forms';
import { Formik, Form, useFormikContext } from 'formik';
const MacroArgumentsWrapper = styled.div`
`;
function MacroArgument({ arg, namePrefix }) {
const name = `${namePrefix}${arg.name}`;
if (arg.type == 'text') {
@@ -37,12 +41,12 @@ function MacroArgumentList({ args, onChangeValues, namePrefix }) {
if (onChangeValues) onChangeValues(values);
}, [values]);
return (
<>
<MacroArgumentsWrapper>
{' '}
{args.map((arg) => (
<MacroArgument arg={arg} key={arg.name} namePrefix={namePrefix} />
))}
</>
</MacroArgumentsWrapper>
);
}