feat(inputs): ✨ Add number input
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user