|
1 | 1 | // import { Joystick3d } from './UI/Joystick3d'
|
2 |
| -// import type { Vector3jProps } from './vector3j-types' |
| 2 | +import type { Vector3jProps, Vector3dProps } from './vector3j-types' |
3 | 3 |
|
4 | 4 | // export function Vector3j() {
|
5 | 5 | // const { label, displayValue, onUpdate, settings } = useInputContext<Vector3jProps>()
|
|
14 | 14 | // )
|
15 | 15 | // }
|
16 | 16 |
|
17 |
| -import React, { forwardRef } from 'react' |
| 17 | +import React from 'react' |
18 | 18 | import { Components, useInputContext } from 'leva/plugin'
|
19 |
| -import DatePicker, { CalendarContainer } from 'react-datepicker' |
20 |
| -import 'react-datepicker/dist/react-datepicker.css' |
21 |
| -import { DateCalendarContainerProps, DateInputProps, DateProps } from './vector3j-types' |
22 |
| -import { InputContainer, StyledInput, StyledWrapper } from './StyledVector3j' |
| 19 | +import { InputContainer } from './StyledVector3j' |
23 | 20 |
|
24 | 21 | const { Label, Row, Vector } = Components
|
25 | 22 |
|
26 |
| -const DateCalendarContainer = ({ children }: DateCalendarContainerProps) => { |
27 |
| - return ( |
28 |
| - <CalendarContainer> |
29 |
| - <StyledWrapper>{children}</StyledWrapper> |
30 |
| - </CalendarContainer> |
31 |
| - ) |
32 |
| -} |
33 |
| - |
34 |
| -const DateInput = forwardRef<HTMLInputElement, Partial<DateInputProps>>(({ value, onClick, onChange }, ref) => { |
35 |
| - return <StyledInput ref={ref} value={value} onClick={onClick} onChange={onChange} /> |
36 |
| -}) |
37 |
| - |
38 | 23 | export function Vector3j() {
|
39 |
| - const { label, value, onUpdate, settings } = useInputContext<DateProps>() |
| 24 | + const { label, displayValue, onUpdate, settings } = useInputContext<Vector3dProps>() |
| 25 | + |
| 26 | + console.log('Vector3j', displayValue, settings) |
40 | 27 |
|
| 28 | + /* FIXME: replace true with !!settings.joystick */ |
| 29 | + /* FIXME: replace true with settings.joystick */ |
41 | 30 | return (
|
42 | 31 | <Row input>
|
43 | 32 | <Label>{label}</Label>
|
44 |
| - <InputContainer> |
45 |
| - <DatePicker |
46 |
| - selected={value.date} |
47 |
| - onChange={onUpdate} |
48 |
| - dateFormat={settings.inputFormat} |
49 |
| - calendarContainer={DateCalendarContainer} |
50 |
| - customInput={<DateInput />} |
51 |
| - /> |
52 |
| - </InputContainer> |
| 33 | + {/* <InputContainer withJoystick={true}> */} |
| 34 | + {/* {true && <Joystick3d value={displayValue} settings={settings} onUpdate={onUpdate} />} */} |
| 35 | + <Vector value={displayValue} settings={settings} onUpdate={onUpdate} /> |
| 36 | + {/* </InputContainer> */} |
53 | 37 | </Row>
|
54 | 38 | )
|
55 | 39 | }
|
56 |
| - |
57 |
| -/* FIXME: replace true with !!settings.joystick */ |
58 |
| -/* FIXME: replace true with settings.joystick */ |
59 |
| -/* |
60 |
| -<Row input> |
61 |
| -<Label>{label}</Label> |
62 |
| -<InputContainer withJoystick={true}> |
63 |
| - {true && <Joystick3d value={displayValue} settings={settings} onUpdate={onUpdate} />} |
64 |
| - <Vector value={displayValue} settings={settings} onUpdate={onUpdate} /> |
65 |
| -</InputContainer> |
66 |
| -</Row> |
67 |
| -*/ |
0 commit comments