summaryrefslogtreecommitdiff
path: root/client/components/Tasks/TaskFormView.jsx
blob: 36660de6cb78375368a25ecdc35374f4e54b55a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { h, Component } from 'preact'
import { Link } from 'react-router-dom'

import client from '../../client.js'

export default function TaskFormView (props) {
  console.log(props)
  return (
    <div class='form'>
      <div>
        {props.content && (
          <div>
            {props.content.name}
          </div>
        )}
        <label>content</label>
        <button onClick={props.clearContent}>x</button>
      </div>
      <div>
        {props.style && (
          <div>
            {props.style.name}
          </div>
        )}
        <label>style</label>
        <button onClick={props.clearStyle}>x</button>
      </div>
      <div>
        <input type='range' step='0.01' min='0.001' max='1' value={props.alpha}
          onInput={(e) => props.setAlpha(e.target.value)}
        />
        alpha: {props.alpha}
      </div>
      <div>
        <button onClick={props.createTask}>Create</button>
      </div>
    </div>
  )
}