mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
move general componets out from wizard
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import React from 'react'
|
||||
|
||||
const Required = () => <span>*</span>
|
||||
export default Required
|
||||
Reference in New Issue
Block a user