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
|
import React from 'react';
import CharLimit from './decorators/CharLimit'
import styled from 'styled-components'
import FloatingLabel from './decorators/FloatingLabel'
import Dropdown from 'react-dropdown';
const RelPositioning = styled.div`
position: relative;
`
const FlexChild = styled.div`
display: block;
margin-left: 2em;
`
class TitleInput extends React.Component {
render() {
return (
<RelPositioning>
<FloatingLabel
label="title"
id={this.props.id}
value={this.props.value} />
<input
name="title"
readOnly={this.props.readOnly}
className="lt-shadow"
placeholder="Title"
id={this.props.id}
type="text"
autoFocus
autoComplete="off"
onChange={this.props.onChange}
value={this.props.value} />
<CharLimit
content={this.props.value}
maxLength={this.props.maxLength} />
</RelPositioning>
);
}
}
class PasteInput extends React.Component {
render() {
return (
<RelPositioning>
<FloatingLabel
label="content"
id={this.props.id}
value={this.props.content} />
<textarea
name="content"
readOnly={this.props.readOnly}
placeholder="Paste your text here"
value={this.props.content}
id={this.props.id}
required
onChange={this.props.onChange}
className="lt-shadow" />
<CharLimit
content={this.props.content}
maxLength={this.props.maxLength} />
</RelPositioning>
);
}
}
class PassInput extends React.Component {
render() {
return (
<FlexChild>
<RelPositioning>
<FloatingLabel
label="password"
id={this.props.id}
value={this.props.value} />
<input
name="pass"
className="lt-shadow"
placeholder="password"
type="password"
autoComplete="off"
onChange={this.props.onChange}
value={this.props.value}
id={this.props.id} />
</RelPositioning>
</FlexChild>
);
}
}
class ExpiryInput extends React.Component {
_onSelect(option) {
this.callBackRef({target: {
name: 'expiry',
value: option.label
}});
}
render() {
const options = [
'5 years',
'1 year',
'1 month',
'1 week',
'1 day',
'1 hour',
'10 min',
];
return (
<FlexChild>
<Dropdown
options={options}
onChange={this._onSelect}
callBackRef={this.props.onChange}
value={this.props.value}
placeholder="1 week"
id={this.props.id} />
<FloatingLabel
label="expiry"
id={this.props.id}
value={this.props.value} />
</FlexChild>
);
}
}
class PasteURLInput extends React.Component {
render() {
return (
<FlexChild>
<RelPositioning>
<FloatingLabel
label="url"
id={this.props.id}
value={this.props.id} />
<input
name="paste_url"
className="lt-shadow"
type="text"
readOnly
autoFocus
id={this.props.id}
value={this.props.fullURL} />
</RelPositioning>
</FlexChild>
);
}
}
export { TitleInput, PasteInput, PassInput, ExpiryInput, PasteURLInput }
|