2
0

feat(inputs): Add number input

This commit is contained in:
Baptiste Arnaud
2022-01-08 07:40:55 +01:00
parent 2a040308db
commit d54ebc0cbe
33 changed files with 467 additions and 207 deletions

View File

@ -1,4 +1,4 @@
import { Step, StepType } from 'models'
import { BubbleStep, BubbleStepType, InputStep, InputStepType } from 'models'
import {
createContext,
Dispatch,
@ -8,19 +8,24 @@ import {
useState,
} from 'react'
export type DraggableStep = BubbleStep | InputStep
export type DraggableStepType = BubbleStepType | InputStepType
const dndContext = createContext<{
draggedStepType?: StepType
setDraggedStepType: Dispatch<SetStateAction<StepType | undefined>>
draggedStep?: Step
setDraggedStep: Dispatch<SetStateAction<Step | undefined>>
draggedStepType?: DraggableStepType
setDraggedStepType: Dispatch<SetStateAction<DraggableStepType | undefined>>
draggedStep?: DraggableStep
setDraggedStep: Dispatch<SetStateAction<DraggableStep | undefined>>
}>({
setDraggedStep: () => console.log("I'm not implemented"),
setDraggedStepType: () => console.log("I'm not implemented"),
})
export const DndContext = ({ children }: { children: ReactNode }) => {
const [draggedStep, setDraggedStep] = useState<Step | undefined>()
const [draggedStepType, setDraggedStepType] = useState<StepType | undefined>()
const [draggedStep, setDraggedStep] = useState<DraggableStep | undefined>()
const [draggedStepType, setDraggedStepType] = useState<
DraggableStepType | undefined
>()
return (
<dndContext.Provider