move general componets out from wizard

This commit is contained in:
Thomas Ruoff
2020-10-07 23:11:07 +02:00
parent db37b76a6e
commit f78b8ea772
7 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import React, { useContext } from 'react'
import { WizardContext } from './context/wizardStore'
import Input from './input'
import Input from '../input'
export default function Contact() {
const { state, onChangeEvent } = useContext(WizardContext)

View File

@@ -1,6 +1,6 @@
import React, { useContext } from 'react'
import { WizardContext } from './context/wizardStore'
import InputWrapper from './inputWrapper'
import InputWrapper from '../inputWrapper'
export default function DateSelect() {
const { onChangeEvent, state } = useContext(WizardContext)

View File

@@ -1,17 +0,0 @@
import React from 'react'
import InputWrapper from './inputWrapper'
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
label: string
}
export default function Input(props: InputProps) {
const { label, required, type = 'text', ...rest } = props
return (
<InputWrapper label={label} required={required}>
<input type={type} required={required} className="input-text" {...rest} />
</InputWrapper>
)
}

View File

@@ -1,23 +0,0 @@
import React from 'react'
import Required from './required'
export default function Input(props: {
label: string
required: boolean
children: React.ReactNode
}) {
const { label, required, children } = props
return (
<>
<div className="fsw">
<div className="fs">
<label className="flabel">
{label} {required && <Required />}
</label>
{children}
</div>
</div>
</>
)
}

View File

@@ -1,6 +1,6 @@
import React, { useContext } from 'react'
import { WizardContext } from './context/wizardStore'
import Input from './input'
import Input from '../input'
export default function Contact() {
const { state, onChangeEvent } = useContext(WizardContext)

View File

@@ -1,4 +0,0 @@
import React from 'react'
const Required = () => <span>*</span>
export default Required