Small usability tweaks to the add existing to space dialog

This commit is contained in:
Michael Telatynski 2021-03-24 14:10:26 +00:00
parent f7a3805eed
commit 6e0ab86168
2 changed files with 40 additions and 29 deletions

View file

@ -28,22 +28,23 @@ limitations under the License.
flex-direction: column; flex-direction: column;
flex-wrap: nowrap; flex-wrap: nowrap;
min-height: 0; min-height: 0;
height: 80vh;
.mx_Dialog_title { .mx_Dialog_title {
display: flex; display: flex;
.mx_BaseAvatar {
display: inline-flex;
margin: 5px 16px 5px 5px;
vertical-align: middle;
}
.mx_BaseAvatar_image { .mx_BaseAvatar_image {
border-radius: 8px; border-radius: 8px;
margin: 0; margin: 0;
vertical-align: unset; vertical-align: unset;
} }
.mx_BaseAvatar {
display: inline-flex;
margin: 5px 16px 5px 5px;
vertical-align: middle;
}
> div { > div {
> h1 { > h1 {
font-weight: $font-semi-bold; font-weight: $font-semi-bold;
@ -101,6 +102,7 @@ limitations under the License.
.mx_SearchBox { .mx_SearchBox {
margin: 0; margin: 0;
flex-grow: 0;
} }
.mx_AddExistingToSpaceDialog_errorText { .mx_AddExistingToSpaceDialog_errorText {
@ -112,7 +114,10 @@ limitations under the License.
} }
.mx_AddExistingToSpaceDialog_content { .mx_AddExistingToSpaceDialog_content {
flex-grow: 1;
.mx_AddExistingToSpaceDialog_noResults { .mx_AddExistingToSpaceDialog_noResults {
display: block;
margin-top: 24px; margin-top: 24px;
} }
} }
@ -162,8 +167,14 @@ limitations under the License.
> span { > span {
flex-grow: 1; flex-grow: 1;
font-size: $font-12px; font-size: $font-14px;
line-height: $font-15px; line-height: $font-15px;
font-weight: $font-semi-bold;
.mx_AccessibleButton {
font-size: inherit;
display: inline-block;
}
> * { > * {
vertical-align: middle; vertical-align: middle;

View file

@ -109,7 +109,7 @@ const AddExistingToSpaceDialog: React.FC<IProps> = ({ matrixClient: cli, space,
const title = <React.Fragment> const title = <React.Fragment>
<RoomAvatar room={selectedSpace} height={40} width={40} /> <RoomAvatar room={selectedSpace} height={40} width={40} />
<div> <div>
<h1>{ _t("Add existing spaces/rooms") }</h1> <h1>{ _t("Add existing rooms") }</h1>
{ spaceOptionSection } { spaceOptionSection }
</div> </div>
</React.Fragment>; </React.Fragment>;
@ -130,27 +130,6 @@ const AddExistingToSpaceDialog: React.FC<IProps> = ({ matrixClient: cli, space,
autoComplete={true} autoComplete={true}
/> />
<AutoHideScrollbar className="mx_AddExistingToSpaceDialog_content" id="mx_AddExistingToSpaceDialog"> <AutoHideScrollbar className="mx_AddExistingToSpaceDialog_content" id="mx_AddExistingToSpaceDialog">
{ spaces.length > 0 ? (
<div className="mx_AddExistingToSpaceDialog_section mx_AddExistingToSpaceDialog_section_spaces">
<h3>{ _t("Spaces") }</h3>
{ spaces.map(space => {
return <Entry
key={space.roomId}
room={space}
checked={selectedToAdd.has(space)}
onChange={(checked) => {
if (checked) {
selectedToAdd.add(space);
} else {
selectedToAdd.delete(space);
}
setSelectedToAdd(new Set(selectedToAdd));
}}
/>;
}) }
</div>
) : null }
{ rooms.length > 0 ? ( { rooms.length > 0 ? (
<div className="mx_AddExistingToSpaceDialog_section"> <div className="mx_AddExistingToSpaceDialog_section">
<h3>{ _t("Rooms") }</h3> <h3>{ _t("Rooms") }</h3>
@ -172,6 +151,27 @@ const AddExistingToSpaceDialog: React.FC<IProps> = ({ matrixClient: cli, space,
</div> </div>
) : undefined } ) : undefined }
{ spaces.length > 0 ? (
<div className="mx_AddExistingToSpaceDialog_section mx_AddExistingToSpaceDialog_section_spaces">
<h3>{ _t("Spaces") }</h3>
{ spaces.map(space => {
return <Entry
key={space.roomId}
room={space}
checked={selectedToAdd.has(space)}
onChange={(checked) => {
if (checked) {
selectedToAdd.add(space);
} else {
selectedToAdd.delete(space);
}
setSelectedToAdd(new Set(selectedToAdd));
}}
/>;
}) }
</div>
) : null }
{ spaces.length + rooms.length < 1 ? <span className="mx_AddExistingToSpaceDialog_noResults"> { spaces.length + rooms.length < 1 ? <span className="mx_AddExistingToSpaceDialog_noResults">
{ _t("No results") } { _t("No results") }
</span> : undefined } </span> : undefined }