Skip to content

Commit bd242e2

Browse files
committed
tweak datetime display
1 parent f8dcdaa commit bd242e2

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/components/shared/Input.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,15 @@ const DatetimeInput = ({field, name, value, field_label, on_change}) => {
7272
return (
7373
<label>
7474
{field_label}
75-
<div className="tcs-datetime">
75+
<div>
7676
<input type="date"
77+
className="tcs-datetime tcs-date"
7778
name={name + '-date'}
7879
required={required}
7980
value={render_values.date}
8081
onChange={on_change_}/>
8182
<input type="time"
83+
className="tcs-datetime tcs-time"
8284
step="300"
8385
name={name + '-time'}
8486
required={required}

src/styles/input.scss

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@import '../conf';
22

3-
$border-colour: #66afe9;
3+
$border-colour: #aaa;
4+
$border-highlight-colour: #66afe9;
5+
$border-radius: 5px;
46
.tcs-field {
57
&.required {
68
.help-text {
@@ -17,14 +19,14 @@ $border-colour: #66afe9;
1719
padding: 8px 12px 10px;
1820
margin: 0;
1921
height: inherit;
20-
border-radius: 5px;
21-
border: 1px solid #aaa;
22+
border-radius: $border-radius;
23+
border: 1px solid $border-colour;
2224
font-family: inherit;
2325
outline: none;
2426
background-color: white;
2527
&:focus {
26-
border-color: $border-colour;
27-
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px lighten($border-colour, 20%);
28+
border-color: $border-highlight-colour;
29+
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px lighten($border-highlight-colour, 20%);
2830
}
2931
&:required {
3032
border: 1px solid #888;
@@ -43,13 +45,15 @@ $border-colour: #66afe9;
4345
display: none;
4446
}
4547
}
46-
.tcs-datetime input {
47-
width: calc(50% - 5px);
48-
&:first-child {
49-
margin-right: 5px
50-
}
51-
&:last-child {
52-
margin-left: 5px;
53-
}
48+
.tcs-datetime {
49+
width: 50%;
50+
&.tcs-date {
51+
border-radius: $border-radius 0 0 $border-radius;
52+
border-right: 1px solid lighten($border-colour, 20%);
53+
}
54+
&.tcs-time {
55+
border-radius: 0 $border-radius $border-radius 0;
56+
border-left: none;
57+
}
5458
}
5559
}

0 commit comments

Comments
 (0)