UX: full revamp of local-dates form (#7357)

This commit is contained in:
Joffrey JAFFEUX
2019-04-11 11:14:34 +02:00
committed by GitHub
parent 110512d4d0
commit 7226240df3
5 changed files with 352 additions and 167 deletions

View File

@ -57,11 +57,30 @@
}
.discourse-local-dates-create-modal {
min-height: 250px;
min-height: 320px;
display: flex;
flex-direction: row;
padding: 0.5em;
.picker-panel {
padding: 5px;
border: 1px solid $primary-low;
}
.date-picker {
display: flex;
flex-direction: column;
width: auto;
box-sizing: border-box;
.pika-single {
position: relative !important;
flex: 1;
display: flex;
border: 0;
}
}
.form {
flex: 1 0 0px;
@ -72,60 +91,149 @@
.date-time-configuration {
display: flex;
.range,
.timezone {
display: flex;
justify-content: flex-start;
flex: 1;
align-items: center;
.from {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.to {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.to-indicator {
display: flex;
flex-direction: row;
padding-top: 0.5em;
margin: 0 0.5em;
font-size: $font-up-2;
}
.fake-input {
display: none;
}
.date {
margin-right: 0.5em;
.date-input {
width: 100px;
text-align: center;
.date-picker {
padding: 0;
margin: 0;
width: 100%;
.timezone-input {
width: 100%;
&.is-expanded {
.select-kit-header {
border: 1px solid $primary-medium;
}
}
.select-kit-header {
padding: 0.5em 0.5em;
border: 1px solid $primary-low;
.d-icon {
margin-right: 1em;
}
.caret-icon {
margin-right: 0;
}
}
}
.timezone {
margin-left: 1em;
.timezone-input {
width: 160px;
.date-time-control {
position: relative;
display: flex;
border: 1px solid $primary-low;
&.is-filled,
&.is-selected {
.date-time {
color: $primary;
background: $secondary;
}
.d-icon {
color: $primary-high;
}
}
&.from {
border-radius: 5px 5px 0 0;
.date-time {
border-radius: 5px 5px 0 0;
}
&.is-selected {
border-color: $tertiary;
}
}
&.to {
border-radius: 0 0 5px 5px;
margin-bottom: 1em;
.date-time {
border-radius: 0 0 5px 5px;
padding-right: 3em;
}
&.is-selected {
border-color: $tertiary;
}
}
.date-time {
color: $primary-medium;
background: $primary-very-low;
}
.d-icon {
position: absolute;
margin-top: auto;
margin-bottom: auto;
left: 0.5em;
top: 0;
bottom: 0;
color: $primary-medium;
}
.delete-to-date {
position: absolute;
margin-top: auto;
margin-bottom: auto;
right: 0;
width: 30px;
top: 0;
bottom: 0;
color: $primary-high;
border-radius: 0 0 5px 0;
}
.date-time {
padding: 1em 0.5em 1em 2em;
border: 0;
outline: none;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
text-align: left;
}
}
.time {
.time-input {
width: auto;
.inputs-panel {
flex: 1;
}
.picker-panel {
z-index: 1;
background: $secondary;
width: 200px;
box-sizing: border-box;
margin-left: 1em;
}
.time-pickers {
display: flex;
justify-content: center;
flex: 1;
margin-top: 1em;
align-items: center;
padding: 0.25em;
border-top: 1px solid $primary-low-mid;
box-sizing: border-box;
.d-icon {
color: $primary-medium;
}
.time-picker {
outline: none;
box-shadow: none;
margin: 0;
padding: 0;
text-align: center;
box-sizing: border-box;
width: 100%;
border: 0;
}
}
}
@ -188,54 +296,30 @@
}
}
@media (max-width: 700px) {
.discourse-local-dates-create-modal {
.from,
.to {
width: 100%;
html:not(.mobile-view) {
.discourse-local-dates-create-modal.modal-body {
width: 600px;
max-height: 400px;
}
}
html.mobile-view {
.discourse-local-dates-create-modal.modal-body {
.date-time-configuration {
flex-direction: column;
}
.form {
.date-time-configuration {
flex-direction: column;
.range,
.timezone {
display: flex;
flex: 1;
flex-direction: column;
.picker-panel {
width: 100%;
margin: 0 0 1em 0;
.controls,
.control-group {
width: 100%;
}
.to-indicator {
margin: 0 0.5em;
padding: 0;
}
}
.date {
.date-input {
width: 100%;
}
}
.time {
.time-input {
width: 100%;
}
}
.timezone {
margin: 0.5em 0 0 0;
padding: 0.5em 0 0 0;
border-top: 1px solid $primary-low;
.timezone-input {
width: 100%;
}
}
.pika-single {
justify-content: center;
}
}
.time-picker {
padding-top: 6px;
}
}
}