blob: 425a605e9b36d5ae1fb67ca13fa21f17f31afa7a (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
import React from 'react'
import {
NumberInput, ColorInput,
Select, TextArea, Checkbox
} from 'app/common'
import { TEXT_FONT_FAMILIES, TEXT_FONT_STYLES, MARQUEE_DIRECTIONS } from './tile.constants'
export default function TileTextForm({ tile, errorFields, parent }) {
return (
<div>
<TextArea
title=""
name="content"
required
data={tile.settings}
error={errorFields.has('content')}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
<div className='row font'>
<Select
title="Font"
name='font_family'
selected={tile.settings.font_family || 'sans-serif'}
options={TEXT_FONT_FAMILIES}
onChange={parent.handleSettingsSelect}
/>
<NumberInput
title=''
name='font_size'
data={tile.settings}
min={1}
max={1200}
error={errorFields.has('font_size')}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
<Select
name='font_style'
selected={tile.settings.font_style || 'normal'}
options={TEXT_FONT_STYLES}
title=''
onChange={parent.handleSettingsSelect}
/>
</div>
<ColorInput
title='Text'
name='font_color'
data={tile.settings}
error={errorFields.has('font_color')}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
<ColorInput
title='BG'
name='background_color'
data={tile.settings}
error={errorFields.has('background_color')}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
<div className='row pair'>
<NumberInput
title="Width"
name="width"
data={tile.settings}
min={0}
max={1200}
error={errorFields.has('width')}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
<NumberInput
title="Height"
name="height"
data={tile.settings}
min={0}
max={1200}
error={errorFields.has('height')}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
</div>
<Checkbox
label="Marquee"
name="is_marquee"
className='short'
checked={tile.settings.is_marquee}
onChange={parent.handleSettingsSelect}
autoComplete="off"
/>
{tile.settings.is_marquee && (
<div>
<div className='row single'>
<Select
title="Direction"
name='marquee_direction'
selected={tile.settings.marquee_direction || 'left'}
options={MARQUEE_DIRECTIONS}
onChange={parent.handleSettingsSelect}
/>
</div>
<div className="row single_text">
<NumberInput
title="Speed"
name="marquee_speed"
data={tile.settings}
step={1}
min={0}
max={1000}
defaultValue={20}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
</div>
<div className="row single_text">
<NumberInput
title="Content width"
name="marquee_content_width"
data={tile.settings}
step={1}
min={0}
max={5000}
defaultValue={200}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
</div>
<div className="row single_text">
<NumberInput
title="Content height"
name="marquee_content_height"
data={tile.settings}
step={1}
min={0}
max={2000}
defaultValue={parseInt(tile.settings.font_size) + 10}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
</div>
<Checkbox
label="Marquee gradient"
name="marquee_gradient"
className='short'
checked={tile.settings.marquee_gradient}
onChange={parent.handleSettingsSelect}
autoComplete="off"
/>
{tile.settings.marquee_gradient && (
<ColorInput
title='Color'
name='marquee_gradient_color'
data={tile.settings}
onChange={parent.handleSettingsChange}
autoComplete="off"
/>
)}
</div>
)}
</div>
)
}
|