UX: Full width/height modal (#61)

This commit is contained in:
Keegan George 2023-08-31 09:28:05 -07:00 committed by GitHub
parent 116bcb9c3a
commit c050e072e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 50 deletions

View File

@ -4,27 +4,6 @@
class="insert-table-modal" class="insert-table-modal"
> >
<:body> <:body>
{{#if this.isEditingTable}}
<div class="edit-reason">
<DButton
@icon="info-circle"
@title={{theme-prefix
"discourse_table_builder.edit.modal.trigger_reason"
}}
@action={{this.showEditReasonField}}
@class="btn btn-icon btn-flat no-text btn-edit-reason"
/>
{{#if this.showEditReason}}
<TextField
@value={{this.editReason}}
@placeholderKey={{theme-prefix
"discourse_table_builder.edit.modal.reason"
}}
/>
{{/if}}
</div>
{{/if}}
<ConditionalLoadingSpinner @condition={{this.loading}}> <ConditionalLoadingSpinner @condition={{this.loading}}>
<div <div
{{did-insert this.createSpreadsheet}} {{did-insert this.createSpreadsheet}}
@ -50,6 +29,26 @@
</div> </div>
<div class="secondary-actions"> <div class="secondary-actions">
{{#if this.isEditingTable}}
<div class="edit-reason">
<DButton
@icon="info-circle"
@title={{theme-prefix
"discourse_table_builder.edit.modal.trigger_reason"
}}
@action={{this.showEditReasonField}}
@class="btn-edit-reason"
/>
{{#if this.showEditReason}}
<TextField
@value={{this.editReason}}
@placeholderKey={{theme-prefix
"discourse_table_builder.edit.modal.reason"
}}
/>
{{/if}}
</div>
{{/if}}
<DPopover> <DPopover>
<DButton class="trigger" @icon="question" /> <DButton class="trigger" @icon="question" />
<ul> <ul>

View File

@ -60,11 +60,7 @@ export default class SpreadsheetEditor extends Component {
@action @action
showEditReasonField() { showEditReasonField() {
if (this.showEditReason) { this.showEditReason = !this.showEditReason;
this.showEditReason = false;
} else {
this.showEditReason = true;
}
} }
@action @action

View File

@ -25,24 +25,16 @@
.modal-inner-container { .modal-inner-container {
--modal-max-width: $reply-area-max-width; --modal-max-width: $reply-area-max-width;
width: $reply-area-max-width; width: 100%;
height: 100%;
@media screen and (max-width: 1200px) { display: grid;
--modal-max-width: 90%; grid-template-rows: auto 1fr auto;
width: 100vw;
}
} }
.modal-body { .modal-body {
padding: 0; padding: 0;
margin: 0.5em; margin: 0;
}
.btn-edit-reason {
background: none;
.d-icon {
color: var(--primary-high);
}
} }
.modal-footer { .modal-footer {
@ -50,6 +42,26 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.secondary-actions {
display: flex;
align-items: center;
gap: 0.5rem;
.edit-reason {
display: flex;
align-items: center;
gap: 0.5rem;
}
.btn {
margin-right: 0;
}
input {
margin: 0;
}
}
.secondary-actions .tippy-content { .secondary-actions .tippy-content {
h4 { h4 {
color: var(--primary); color: var(--primary);
@ -60,15 +72,4 @@
} }
} }
} }
.jexcel_container {
padding: 0.5em;
min-width: 100%;
.jexcel_content {
min-width: 100%;
table.jexcel {
min-width: 100%;
}
}
}
} }

View File

@ -254,3 +254,19 @@ table.jexcel > tbody > tr > td {
.jcontextmenu > div:not(.contextmenu-line):last-child { .jcontextmenu > div:not(.contextmenu-line):last-child {
display: none; display: none;
} }
.jexcel_container {
padding: 0.5em;
min-width: 100%;
.jexcel_content {
min-width: 100%;
padding: 0;
table.jexcel {
min-width: 100%;
}
}
}
.jexcel_container {
padding: 0;
}